ok, thank you
it was the first time i'm using a filter an for thouse with similar (no)skills and some ideas here my sample code to manipulate the title based on a category
/**
this is from http://codex.wordpress.org/Fun…..n_category
* Tests if any of a post's assigned categories are descendants of target categories
*
* @param mixed $cats The target categories. Integer ID or array of integer IDs
* @param mixed $_post The post
* @return bool True if at least 1 of the post's categories is a descendant of any of the target categories
* @see get_term_by() You can get a category by name or slug, then pass ID to this function
* @uses get_term_children() Gets descendants of target category
* @uses in_category() Tests against descendant categories
* @version 2.7
*/
function post_is_in_descendant_category( $cats, $_post = null )
{
foreach ( (array) $cats as $cat ) {
// get_term_children() accepts integer ID only
$descendants = get_term_children( (int) $cat, 'category');
if ( $descendants && in_category( $descendants, $_post ) )
return true;
}
return false;
}
/*
*
* here comes my come line of code
*
*/
function mycustom_aiosplugin_single_post_title($aiosplugin_title) {
global $id, $post;
// i only want to change the title on single post pages
if ( is_single() ) {
// and only for this categories or their sub-categorie i want to add some keyword
if ( in_category( array( 'category_slug', 'or_an_other_or_the_id', 4) ) || post_is_in_descendant_category( array( 'slug', 'slug', CatID) ) ) {
// here i put my keyword in $r
$r = 'my keyword, ';
};
// this returns the new title where i add $r to the front of the title as set in the all in one seo plugin
return $r.' '. $aiosplugin_title;
}
// this make it connect to the wordpress system
add_filter('single_post_title','mycustom_aiosplugin_single_post_title');
ok, this is realy realy simple to those making this ofter
maybe it helps somebody like me