Don't have access to view Admin posts? Purchase a support subscription
Topic RSS
2:51 pm
July 9, 2012
OfflineTo the team at Semper Plugins,
I've got a WP site where Custom Post Types (and associated taxonomies) have been set up; as things stand, I'd like to add a prefix to the page title on archive pages for the taxonomies, and read elsewhere on these forums that the WP Category Meta plug-in might be of some help in achieving this – http://wordpress.org/extend/pl…..gory-meta/
I've now installed the plug-in (though it looks like it is no longer in active development as the author doesn't have the time to put into the project), and have created a "Meta" for one of my taxonomies to try things out. The problem is that the information is being saved to the database, but I can't get it to override the page title that AIOSEOP Pro inserts into category archives.
So far, I've tried adding the following to my theme's header.php file (I also tried the functions.php too), but to no avail sadly:
function sfwd_set_cubecat_category_title( $title ) {
if (function_exists('get_terms_meta')) {
$category_id = get_queried_object_id();
if (!$category_id) return $title;
$title = get_terms_meta($category_id, 'citiesmeta');
if ( is_array($title) ) $title = $title[0];
}
return $title;
}
add_filter('single_cat_title', 'sfwd_set_cubecat_category_title');
Any help with this would be gratefully received.
3:36 pm
October 16, 2011
Offline** You currently do not have permission to see this post. To obtain access to Admin posts please purchase a support subscription from Semper Plugins **
4:00 pm
July 9, 2012
OfflineHi Peter,
Thanks for the speedy reply to my conundrum!
I'm definitely using %category_title% in my AIOSEOP settings, but interestingly, if I put a prefix before this, it doesn't show up on my Custom Post Type/Custom Taxonomy archives, which I guess means that my custom taxonomies aren't getting "thought of" as categories.
Any ideas as to what I can do about this? Maybe I got something wrong in the register_taxonomy I set up in my functions.php?
Any ideas as to what I can try next?
4:21 pm
October 16, 2011
Offline** You currently do not have permission to see this post. To obtain access to Admin posts please purchase a support subscription from Semper Plugins **
4:47 pm
July 9, 2012
OfflineHi Peter,
Just a quick thought – if I have two separate custom taxonomies that I wanted to get the titles that had been added through the WP Category Meta plugin, how would I set up the function shown above? I've tried the following (creating two functions), but it only gets titles from one of the two taxonomies when I do this
Once again, if you have any suggestions as to how the best way to proceed would be, I'd be enormously grateful!
function sfwd_set_cities_taxonomy_title( $title ) {
if (function_exists('get_terms_meta')) {
$category_id = get_queried_object_id();
if (!$category_id) return $title;
$title = get_terms_meta($category_id, 'citiesmeta');
if ( is_array($title) ) $title = $title[0];
}
return $title;
}
add_filter('single_term_title', 'sfwd_set_cities_taxonomy_title');
function sfwd_set_lander_taxonomy_title( $title ) {
if (function_exists('get_terms_meta')) {
$category_id = get_queried_object_id();
if (!$category_id) return $title;
$title = get_terms_meta($category_id, 'landermeta');
if ( is_array($title) ) $title = $title[0];
}
return $title;
}
add_filter('single_term_title', 'sfwd_set_lander_taxonomy_title');
4:55 pm
October 16, 2011
Offline** You currently do not have permission to see this post. To obtain access to Admin posts please purchase a support subscription from Semper Plugins **
5:08 am
July 9, 2012
OfflineSadly, I have to report that it's stopped working as far as I can see; as of WordPress 3.5/AIOSEOP Pro 2.0.5, the custom meta information for taxonomies isn't returned any more using that function
In the WP admin area, it appears that the page titles I added using the WP Category Meta plugin are still in place, but are no longer being outputted by AIOSEOP – just wondering if any of you might have any ideas as to how I can fix this?
The reason I ask is that rather unusually, in the case of this one particular site, I need to get the Taxonomy archives crawled!
10:31 am
October 16, 2011
Offline** You currently do not have permission to see this post. To obtain access to Admin posts please purchase a support subscription from Semper Plugins **
10:05 am
October 16, 2011
Offline** You currently do not have permission to see this post. To obtain access to Admin posts please purchase a support subscription from Semper Plugins **
2:47 pm
October 16, 2011
Offline** You currently do not have permission to see this post. To obtain access to Admin posts please purchase a support subscription from Semper Plugins **
Most Users Ever Online: 964
Currently Online:
3 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Member Stats:
Guest Posters: 6
Members: 3121
Moderators: 2
Admins: 5
Forum Stats:
Groups: 4
Forums: 28
Topics: 430
Posts: 1632
Newest Members: evanmoerkerk@yahoo.com
Moderators: ngerrero (0), mattyrob (89)
Administrators: Semper Plugins (22), Peter Baylies (367), Michael Torbert (0), Steve Mortiboy (239), Steve Klasen (0)
Log In
Register
Home

