There currently isn’t support for this in the plugin, although you should be able to add it using PHP by filtering aioseop_title and aioseop_description; we are planning on adding better support for this integrated into All In One SEO Pack. Below is a basic example of how you’d go about adding a filter here.
add_filter('aioseop_title', 'sfwd_custom_title');
function sfwd_custom_title($title) {
if ( is_category() ) {
$title = "Custom Category Title";
}
return $title;
}
Thread Starter
dbp
(@optimus203)
So if I wanted to assign category title to categories with specific names, I would do something like this?
add_filter('aioseop_title', 'sfwd_custom_title');
function sfwd_custom_title($title) {
if ( is_category() == "CategoryName" ) {
$title = "Custom Category Title";
}
if ( is_category() == "CategoryName2" ) {
$title = "Custom Category Title";
}
return $title;
}
add_filter('aioseop_description', 'sfwd_custom_desc');
function sfwd_custom_desc($title) {
if ( is_category() == "CategoryName" ) {
$description = "Custom Category Description";
}
if ( is_category() == "CategoryName2" ) {
$description = "Custom Category Description";
}
return $description;
}
That’s close; but actually that should be is_category( “CategoryName” ) – check the Codex page for is_category() here.
add_filter('aioseop_title', 'sfwd_custom_title');
function sfwd_custom_title($title) {
if ( is_category( "CategoryName" ) ) {
$title = "Custom Category Title";
} elseif ( is_category( "CategoryName2" ) ) {
$title = "Custom Category Title 2";
}
return $title;
}
Thread Starter
dbp
(@optimus203)
Brilliant. That worked perfectly. Thanks for the help Peter.