Problem after WP update to 6.7
-
Hello,
I have been using Simple Taxonomy Refreshed plugin for some time. After the most recent WordPress update (to version 6.7) I am not able to show my custom taxonomy (fe-quthor) on pages made with a custom template.
I tried de-activating and activating the plugin without success.
I also tried re-loading a previous version of my theme, also no improvement.
To see an example of the fe-author custom taxonomy in use, please refer to the following page, which will display the “by” line for the story…
https://www.fifthestate.org/archive/102-april-2-15-1970/masthead/
I will appreciate any and all help with this problem.
Robby Barnes
The page I need help with: [log in to see the link]
-
I am sorry to hear that you are having problems with my plugin and WP 6.7 and thank you for raising it with me.
I have looked at the page. I can agree that there is no reference to this taxonomy there.
Please could you do two thing to help me identify the problem:
- Go into the Taxonomies screen and, for the fe-author taxonomy, click the
Export PHP
option. This will create a file that you can download to your device that contains the parameters you have used to create the taxonomy. Please can you reply with this. I can use it to create the same taxonomy in my system. - Can you say how you are trying to output the assigned taxonomy elements, including the text of the shortcode or block being used for that.
Thanks for you help.
Neil James
Hello and thanks for your reply. Below I am pasting the fe_author taxonomy PHP file contents. For simplicity I will answer your second request in a separate reply.
<?php
/*
Plugin Name: XXX - FE Authors
Version: x.y.z
Plugin URI: https://www.example.com
Description: XXX - Taxonomy FE Authors
Author: XXX - Simple Taxonomy Refreshed Generator
Author URI: https://www.example.com
----
Copyright 2024 - XXX-Author
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
add_action( 'init', 'register_staxo_fe_author', 10 );
function register_staxo_fe_author() {
register_taxonomy( "fe_author",
array (
0 => 'page',
1 => 'attachment',
),
array (
'name' => 'fe_author',
'description' => '',
'labels' =>
array (
'name' => 'FE Authors',
'singular_name' => 'FE Author',
'search_items' => 'Search FE Authors',
'popular_items' => 'Popular FE Authors',
'all_items' => 'All FE Authors',
'parent_item' => 'Parent FE Author',
'parent_item_colon' => 'Parent FE Author:',
'name_field_description' => 'The name is how it appears on your site.',
'slug_field_description' => 'The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.',
'parent_field_description' => 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.',
'desc_field_description' => 'The description is not prominent by default; however, some themes may show it.',
'edit_item' => 'Edit FE Author',
'view_item' => 'View FE Author',
'update_item' => 'Update FE Authors',
'add_new_item' => 'Add New FE Author',
'new_item_name' => 'New FE Author Name',
'separate_items_with_commas' => 'Separate terms with commas',
'add_or_remove_items' => 'Add or remove terms',
'choose_from_most_used' => 'Choose from the most used terms',
'not_found' => 'No Terms found',
'no_terms' => 'No Terms',
'filter_by_item' => 'Filter by category',
'items_list_navigation' => 'Terms list navigation',
'items_list' => 'Terms list',
'most_used' => 'Most Used',
'back_to_items' => '← Back to Terms',
'item_link' => 'Category Link',
'item_link_description' => 'A link to a category.',
'name_admin_bar' => '',
'template_name' => 'Category Archives',
'archives' => 'All Categories',
'no_term' => 'No term',
),
'public' => true,
'publicly_queryable' => true,
'hierarchical' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'show_in_quick_edit' => true,
'show_admin_column' => true,
'capabilities' =>
array (
'manage_terms' => 'manage_categories',
'edit_terms' => 'manage_categories',
'delete_terms' => 'manage_categories',
'assign_terms' => 'edit_posts',
),
'rewrite' =>
array (
'slug' => 'fe_author',
'with_front' => true,
'hierarchical' => true,
'ep_mask' => 0,
),
'query_var' => 'fe_author',
'update_count_callback' => '',
'show_in_rest' => true,
'sort' => false,
) );
}
// Display Terms with Posts: none
// Display Terms Before text:
// Display Terms Separator: ,
// Display Terms After text:
// Show Terms in Feeds:Hello again,
With regard to how I am trying to output the assigned taxonomy elements, including the text of the shortcode or block being used for that, back in 2013 when I started the site, a volunteer (who was a professional programmer) helped me with the site and coded references to the taxonomy into two page templates, one called ‘Article page’ and the other ‘Article–no subtitle.’ I am not a programmer, so I can’t describe the details; but I am familiar with WordPress in general and have admin and SFTP access to the files used for the site.
At this time the custom taxonomy ‘FE Author’ fails to display on pages using either of these templates.
To see how the taxonomy normally works you can access
https://www.fifthestate.org/archive/102-april-2-15-1970/masthead/
Thanks very much for your help this far.
Robby
Thanks for sending the definition through. I have tried it – and it works fine.
However, fine means that in normal use, the taxonomy does not appear in the Front End.
As a test to see whether it will appear, you could try temporarily setting the
Display Terms with Posts
option toContent and excerpt
. This should ordinarily output on the page the value of the taxonomy term, though it does depend on whether your template usesthe_content()
and/orthe_excerpt()
to display these fields. You should in any case revert the option toNone
.Since you want the By line to appear near the top, you’ll need to amend the templates. I tried looking at the WP 6.7 changes, but nothing seemed to be relevant from a quick reading.
Would it be possible to make available the Article template page please?
Note. Since the By-line should appear before the content or excerpt, if your test does output the author term, then the code for the By-line will appear before the code
the_content()
orthe_excerpt()
so only that section is needed.Regards
Neil James
Hello again,
I re-set the
Display Terms with Posts
option toContent and excerpt
as you suggested, but the problem remained.Below I am pasting a copy of the page template for you to look at.
First, I would like to report some troubleshooting I have done on a clone of my site. Up to today it was running on WP 6.2. I updated it to 6.7 (PHP 8.3) and the same problem I am having on the main site appeared. I deactivated all plugins except Simple Taxonomy Refreshed and tried to make a new page using the FE Author terms. The problem remained.
I am using the Classic page editor and the FE Authors list appears in the Page Attributes section. It permits me to check boxes in the FE Authors list but when I click Update and view the page the name (in fact the whole “by” line) does not appear. Returning to the editor I see that the selected box is unchecked.
To clarify, I have not made any changes to the page template, which has been in use since 2013. In any case, below is a current copy from SFTP.
Thanks again for any and all help,
Robby
<div id="content-full" class="grid col-940">
<?php while (have_posts()) : the_post(); ?> <?php $options = get_option('responsive_theme_options'); ?> <?php if ($options['breadcrumb'] == 0): ?> <?php echo responsive_breadcrumb_lists(); ?> <?php endif; ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h1 class="post-title"><font color="B40431"><?php the_title(); ?></font></h1>
ID, ‘fe_author’, ‘by ‘, ‘, ‘, ‘ ‘ ); ?> Fifth Estate #post_parent) { $parent = $wpdb->get_row(“SELECT post_title FROM $wpdb->posts WHERE ID = $post->post_parent”); $parent_link = get_permalink($post->post_parent); ?> “>post_title; ?>
<?php if ( comments_open() ) : ?> <div class="post-meta"> <?php responsive_post_meta_data(); ?> <?php if ( comments_open() ) : ?> <span class="comments-link"> <span class="mdash">—</span> <?php comments_popup_link(__('No Comments ↓', 'responsive'), __('1 Comment ↓', 'responsive'), __('% Comments ↓', 'responsive')); ?> </span> <?php endif; ?> </div><!-- end of .post-meta --> <?php endif; ?> <div class="post-entry"> <?php the_content(__('Read more ›', 'responsive')); ?> <?php wp_link_pages(array('before' => '<div class="pagination">' . __('Pages:', 'responsive'), 'after' => '</div>')); ?> </div><!-- end of .post-entry --> <?php if ( comments_open() ) : ?> <div class="post-data"> <?php the_tags(__('Tagged with:', 'responsive') . ' ', ', ', '<br />'); ?> <?php the_category(__('Posted in %s', 'responsive') . ', '); ?> </div><!-- end of .post-data --> <?php endif; ?> <div class="post-edit"><?php edit_post_link(__('Edit', 'responsive')); ?></div> </div><!-- end of #post-<?php the_ID(); ?> --> <?php comments_template( '', true ); ?> <?php endwhile; ?> <?php if ( $wp_query->max_num_pages > 1 ) : ?> <div class="navigation"> <div class="previous"><?php next_posts_link( __( '‹ Older posts', 'responsive' ) ); ?></div> <div class="next"><?php previous_posts_link( __( 'Newer posts ›', 'responsive' ) ); ?></div> </div><!-- end of .navigation --> <?php endif; ?> <?php else : ?> <h1 class="title-404"><?php _e('404 — Fancy meeting you here!', 'responsive'); ?></h1> <p><?php _e('Don't panic, we'll get through this together. Let's explore our options here.', 'responsive'); ?></p> <h6><?php printf( __('You can return %s or search for the page you were looking for.', 'responsive'), sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', esc_url( get_home_url() ), esc_attr__('Home', 'responsive'), esc_attr__('← Home', 'responsive') )); ?></h6> <?php get_search_form(); ?>
</div><!-- end of #content-full -->
Thank you very much for this.
Thank you for clarifying that you have changed from WP 6.2 as the issue could have arisen from the earlier releases..
Sorry for any confusion about the test I asked you for. This was an attempt to identify whether we could quickly get the taxonomy value printed out – but it relied on having a
the_content()
orthe_excerpt()
in the template. It was not to resolve the issue – not least of all it will be at the end of the content.Sadly the copy of the template did not come out as a single block of code. And, in particular, the part where the taxonomy is output of which the trailing part is
ID, ‘fe_author’, ‘by ‘, ‘, ‘, ‘ ‘ ); ?>
. It would be useful to know what the complete function is please. It will be from the<?php
immediately before this text.The taxonomy applies to both pages and attachments. Which type was it please? I am somewhat disconcerted to see your statement that the setting of the terms did not take. I loaded your taxonomy into my system and the Classic Editor plugin as well. I found no problem to add terms – including using the Quick Edit function.
Thanks for any clarifications you may make,
Neil James
Hello again,
Sorry if I wasn’t clear enough that I have been using the Simple Taxonomy plugin since 2013, and your Refresh version since roughly 2020 when the original plugin no longer worked on updated WP versions.
Responding to your question, my FE Authors taxonomy can be used on either Page or Attachment type, but it is mainly needed for WP pages.
As far as I know, all of the pages made up until the WP 6.7 update are functioning as normal and the problem occurs in adding FE Author terms to new pages or making changes to existing pages.
There are 2 templates on which the taxonomy is used:
- article-no-subtitle.php
- article-page.php
To hopefully simplify things, I have put a copy of the article-no-subtitle page template in Pastebin at
I hope it can facilitate troubleshooting on your end.
As to why the taxonomy works on your system and not on my WP install, I am wondering if this might relate to something going on at my host’s server or some change to my database made my the auto-update option I had set in my Admin dashboard.
I have a good recent site backup that I could restore, but would prefer to solve the problem in the updated WP / Theme / Plugin configuration.
Looking forward to hearing from you again,
Robby Barnes
Thank you very much for this. Looking at the template, the call to output the terms is
the_terms( $post->ID, 'fe_author', 'by ', ', ', ' ' );
I see that you are using PHP 8.3 – which is getting more strict in its processing. You want
$post
to be theglobal $post
and not a local one. I don’t know that this is the issue, but it can be made explicit by addingglobal $post;
to the line, i.e.global $post; the_terms( $post->ID, 'fe_author', 'by ', ', ', ' ' );
Alternatively, you can make it (as used a couple of lines earlier):
the_terms( the_ID(), 'fe_author', 'by ', ', ', ' ' );
Hope this helps,
Neil James
Thanks again. I tried your suggested changes, with no success in WP version 6.7.
Apparently the problem was in that version. Today they offered (and I upgraded to) v. 6.7.1 and the problem went away. Next time I suppose I should wait a week or so to start troubleshooting…
Best wishes,
Robby Barnes
- Go into the Taxonomies screen and, for the fe-author taxonomy, click the
- You must be logged in to reply to this topic.