WordPress.org

Ready to get started?Download WordPress

Forums

ReciPress
Meta Description (4 posts)

  1. gkouvousisg
    Member
    Posted 1 year ago #

    After applying this plugin, all my posts have no meta description..

    Is there any way to call the $summary of the recipe to be used in head as <meta description ???

    http://wordpress.org/extend/plugins/recipress/

    http://wordpress.org/extend/themes/recipress/

  2. Tammy Hart
    Member
    Plugin Author

    Posted 1 year ago #

    In your meta field you can use this function:

    <?php echo recipress_recipe('summary'); ?>

    I haven't tested this, though.

  3. gkouvousisg
    Member
    Posted 1 year ago #

    Thanks for your help!

    I tried this:
    <meta name="description" content="<?php echo recipress_recipe('summary'); ?>"/>

    But this outputs the <p summary> tag too! and the second problem is that it echos the summary in the top of my page.

  4. Tammy Hart
    Member
    Plugin Author

    Posted 1 year ago #

    hmmm.. Then I suppose I need to rework how my functions output their information. I hadn't anticipated this kind of issue. Thank you for your input, I will throw it int he hat for the next update. For now, this should do what you want:

    <?php
    $summary = get_post_meta($post->ID, 'summary', true);
    if(!$summary) $summary = recipress_gen_summary();
    else $summary = $summary[0];
    ?>
    <meta name="description" content="<?php echo $summary; ?>"/>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags