• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Add action to blog page only

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Add action to blog page only

This topic is: not resolved
  • This topic has 5 replies, 2 voices, and was last updated 10 years, 1 month ago by SoZo.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • February 1, 2013 at 9:25 am #17055
    Darren
    Member

    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?

    February 1, 2013 at 9:51 am #17060
    SoZo
    Member

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


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

    February 1, 2013 at 10:07 am #17070
    Darren
    Member

    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
    }
    }

    February 1, 2013 at 11:00 am #17087
    SoZo
    Member

    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

    February 1, 2013 at 11:06 am #17093
    Darren
    Member

    Thanks SoZo - that worked

     

    February 1, 2013 at 11:07 am #17094
    SoZo
    Member

    You're welcome 🙂


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

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Add action to blog page only’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble