WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Category Page Meta Descriptions (5 posts)

  1. michelet
    Member
    Posted 1 year ago #

    I'm using both the category description and the meta description fields for my categories.

    I would like to list each of the categories in the body of my homepage and use the meta description like you would use a post excerpt on a category or archive page.

    It would look something like this...

    [category name]
    [thumbnail from latest post in the category]
    [category meta description]

    I've got the code figured out for the name and thumbnail. I just can't figure out if or how I can display the description. What variable or PHP code do I need to use to display the meta description?

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. michelet
    Member
    Posted 1 year ago #

    I guess I'll just talk to myself since no one else is...

    Tried a bunch of things. Closest I'm getting is ...

    <?php echo get_post_meta($post->ID, '_yoast_wpseo_metadesc', true); ?>

    But that displays the WPSEO description from the post and not the category.

    It seems like I would need something like get_category_meta but from what I can see, that is a different plugin. I've replaced $post->ID with a number of different category-related things but they just yield errors or nothing at all.

    Anyone care to chime in?

  3. thelaw
    Member
    Posted 1 year ago #

    I'm also a little confused by this one and as to why WordPress isn't putting out the meta description in categories despite descriptions being entered. That was until I entered this into the Taxonomies area under description for categories:

    %%category_description%%

  4. itscribe
    Member
    Posted 12 months ago #

    But, how does that translate to being able to call the description of a category from the parent category or another page of the site?

  5. thelaw
    Member
    Posted 12 months ago #

    Without the variable entered the category description you've entered in the categories area in posts isn't going to show up. It uses the description for each category or subcategory you've entered.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic