Add action to blog page only

Community Forums Forums General Discussion Add action to blog page only

This topic is: not resolved

This topic contains 5 replies, has 2 voices, and was last updated by  SoZo 1 year, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #17055

    Darren
    Participant
    Post count: 14

    I am sure this is something eacy to do, but I want to add an action to the blog page only. What do I need to add to my fuctions.php?

    #17060

    SoZo
    Moderator
    Post count: 1573

    You use conditional tags to limit the output to particular sections of the site.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #17070

    Darren
    Participant
    Post count: 14

    thanks sozo, i tried adding something but it didnt work.

     

    // Blog Header
    add_action(‘genesis_after_header’, ‘blog_head’);
    function blog_head() {
    if (is_page_template( ‘blog.php’ )) {
    ?>
    <div id=”featured-area” div class=”wrap”>
    ooh</div>
    <?php
    }
    }

    #17087

    SoZo
    Moderator
    Post count: 1573

    Genesis doesn’t come with a template titled “blog.php” unless you added that template you need to use page_blog.php


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #17093

    Darren
    Participant
    Post count: 14

    Thanks SoZo – that worked

     

    #17094

    SoZo
    Moderator
    Post count: 1573

    You’re welcome :)


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Add action to blog page only’ is closed to new replies.