[Support request] Why meta description of Yoast not displayed?

Home Forums Support [Support request] Why meta description of Yoast not displayed?

Home Forums Support Why meta description of Yoast not displayed?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1423442
    Mohamed

    Hi,

    the meta description of Yoast not displayed with the theme
    so, I tried to run this code

    function add_custom_meta_des(){
    if(is_tax()):
    $yoast_desc = get_term_meta( get_queried_object_id() , '_yoast_wpseo_metadesc', true );
    else:
    $yoast_desc = get_post_meta( get_the_ID(), '_yoast_wpseo_metadesc', true );
    endif;
    
    $metadesc_val = wpseo_replace_vars($yoast_desc, $post );
    $metadesc_val = apply_filters( 'wpseo_metadesc', $metadesc_val );
    
    	if( ! empty( $yoast_desc ) && !is_page('compare') ){	echo '<meta name="description" content="' . $yoast_desc . '" />';}
        echo get_term_meta( get_queried_object_id() , '_yoast_wpseo_metadesc', true ) .'cx';  
      }
    add_action( 'wp_head', 'add_custom_meta_des', 4 ); 

    But it didn’t works !!

    #1423473
    Leo
    Staff
    Customer Support

    Hi there,

    Where did you get the code from?

    Have you checked with YoastSEO’s support?

    Does the code work in a twenty series WP default theme?

    #1423556
    Mohamed

    Hello Leo,

    I research and tried to add this code because the meta description of Yoast not displaying be default in GeneratePress although it works with other theme like Publisher, so I don’t need to ask Yoas support
    Could you help?

    #1424050
    Leo
    Staff
    Customer Support

    What is the meta description field you are referring to? Is this it?
    https://www.screencast.com/t/Wo9unaK5z2

    GP would not hide anything that Yoast displays by default.

    Have you tried it with a twenty series WP theme?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.