0

I'm having an issue with a custom theme whereby All in One SEO pack isn't auto-generating descriptions because I am using a custom field to enter the main body of the page/post. Is there way to specify that All in One SEO uses a specific field to read from for the purpose of generating the SEO content automatically?

migrated from stackoverflow.com Mar 26 '14 at 5:03

This question came from our site for professional and enthusiast programmers.

1

You can not specify which field, but you can use the filter *aioseop_description* to do whatever you want with the description before presenting. So technically, you can use your custom field as follows (untested) :

add_filter('aioseop_description','my_custom_description');
global $post;
function my_custom_description($text) {
$mycustomseo = get_post_meta($post->ID, 'my_custom_field', true);
return $mycustomseo;
}

Replace *my_custom_field* with your custom field.

Source Ref : http://4coder.info/en/blog/2011/all-in-one-seo-pack-customization/

  • Thanks for the help, where would I place this code - in functions.php? – Ben Mar 27 '14 at 10:30
  • Ben, yes that is correct. – Patrick Mar 27 '14 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.