Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Steve M

    (@wpsmort)

    That’s because %category_title% is not supported in the Description Format field. Our developers may be able to provide you with some code to support this for post descriptions.

    Thread Starter gwenm

    (@gwenm)

    yes, I will πŸ˜‰
    Thank you very much

    Hi gwenm,

    Here’s some code for this, add it to a plugin or to the functions.php in your theme:

    add_filter( 'aioseop_description', 'gwenm_aioseop_description' );
    
    function gwenm_aioseop_description( $description ) {
    	if ( is_single() ) {
    		$categories = get_the_category();
    		$category = '';
    		if ( count( $categories ) > 0 ) {
    			$category = $categories[0]->cat_name;
    		}
    		if ( !empty( $category ) ) $description .= " {$category}";
    	}
    	return $category;
    }
    Thread Starter gwenm

    (@gwenm)

    ok, it works ! Thank you very much, your support it’s very nice πŸ˜‰

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Category not appear’ is closed to new replies.