Custom Taxonomy Archives/WP Category Meta | Troubleshooting All in One SEO Pack Pro | Support

Don't have access to view Admin posts? Purchase a support subscription

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Custom Taxonomy Archives/WP Category Meta
July 9, 2012
2:51 pm
Alex Stanhope
Member
Forum Posts: 12
Member Since:
July 9, 2012
Offline

To 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.

July 9, 2012
3:36 pm
Peter Baylies
Admin
Forum Posts: 367
Member Since:
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 **

July 9, 2012
4:00 pm
Alex Stanhope
Member
Forum Posts: 12
Member Since:
July 9, 2012
Offline

Hi 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?

July 9, 2012
4:21 pm
Peter Baylies
Admin
Forum Posts: 367
Member Since:
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 **

July 9, 2012
4:37 pm
Alex Stanhope
Member
Forum Posts: 12
Member Since:
July 9, 2012
Offline

Hi Peter,

single_term_title worked a treat! Thanks so much :)

July 9, 2012
4:47 pm
Alex Stanhope
Member
Forum Posts: 12
Member Since:
July 9, 2012
Offline

Hi 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');

July 9, 2012
4:55 pm
Peter Baylies
Admin
Forum Posts: 367
Member Since:
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 **

July 9, 2012
5:20 pm
Alex Stanhope
Member
Forum Posts: 12
Member Since:
July 9, 2012
Offline

Hi Peter,

Thanks so much – that worked perfectly :)

January 2, 2013
5:08 am
Alex Stanhope
Member
Forum Posts: 12
Member Since:
July 9, 2012
Offline

Sadly, 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!

January 2, 2013
10:31 am
Peter Baylies
Admin
Forum Posts: 367
Member Since:
October 16, 2011
Offline
10

** You currently do not have permission to see this post. To obtain access to Admin posts please purchase a support subscription from Semper Plugins **

January 2, 2013
2:12 pm
Alex Stanhope
Member
Forum Posts: 12
Member Since:
July 9, 2012
Offline
11

Hi Peter,

Thanks for the heads-up on the arrival of 2.0.6 – I'll keep my eyes peeled for the release, and let you know if it doesn't fix things with my particular little issue!

January 5, 2013
5:12 am
Alex Stanhope
Member
Forum Posts: 12
Member Since:
July 9, 2012
Offline
12

Hi Peter,

Firstly, congratulations to you all on the release of AIOSEOP Pro 2.0.6!

I updated the site I was having the issue mentioned above with, but sadly, it doesn't seem to have fixed it :(

Any ideas what we can try next?

January 7, 2013
10:05 am
Peter Baylies
Admin
Forum Posts: 367
Member Since:
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 **

January 9, 2013
2:29 pm
Alex Stanhope
Member
Forum Posts: 12
Member Since:
July 9, 2012
Offline
14

Hi Peter,

Thanks so much for taking the time to look into this on my behalf, and the amended code above has definitely hit the spot! The Taxonomy names are now shown in the titles again, though interestingly, the site name itself is no longer shown! Any ideas how we can get it back?

January 9, 2013
2:47 pm
Peter Baylies
Admin
Forum Posts: 367
Member Since:
October 16, 2011
Offline
15

** You currently do not have permission to see this post. To obtain access to Admin posts please purchase a support subscription from Semper Plugins **

January 9, 2013
3:00 pm
Alex Stanhope
Member
Forum Posts: 12
Member Since:
July 9, 2012
Offline
16

Ah, nice! That was simple enough :)

Thanks again, Peter!

Forum Timezone: America/New_York

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)