WordPress.org

Ready to get started?Download WordPress

Forums

WP Ultimate Recipe
[resolved] Recipe Pages Show Blog Header instead of Recipe Header (3 posts)

  1. ccbraley
    Member
    Posted 6 months ago #

    On the recipe listing page, it correctly has a header of "Recipes" (same name as in the nav bar). However, when you click through to a particular recipe, the page header changes to "News", which is the name of our blog page. We would like the header on the individual recipes to also say "Recipes".

    Recipe listing page: http://beansandgreens.org.previewdns.com/recipes/
    One recipe page: http://beansandgreens.org.previewdns.com/recipe/blueberry-orange-smoothie/

    Help?

    https://wordpress.org/plugins/wp-ultimate-recipe/

  2. BrechtVds
    Member
    Plugin Author

    Posted 6 months ago #

    Hi again,

    I think you can solve this with a custom template for recipe post types.
    You'll have to create a file called single-recipe.php which is the same as single.php but with the changed header.
    There's some more info over here: http://codex.wordpress.org/Post_Type_Templates

    Let me know if this works!

    Kind regards,
    Brecht

  3. ccbraley
    Member
    Posted 6 months ago #

    Instead of creating a whole new template, I added this code to the single.php file (below). If the post is in the News category (blog), then it displays the "News" title, otherwise it displays the "Recipes" title. I realize this code will have to change if we add more post categories.

    <?php
    if (in_category("2")) {
    _e('News','wpex');
    } else {
    _e('Recipes','wpex');
    }
    ?>

    Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.