Slideshow on Blog Page Only

Community Forums Forums Design Tips and Tricks Slideshow on Blog Page Only

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  braddalton 1 year, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25455

    ohsnapjulie
    Participant

    Hello,

    I am working on this website: http://www.honeyhilldesigns.com

    I found a way to add the slideshow to the top of the blog page just how I want it. However, it is also appearing on all of the other pages.  How can I edit my functions.php file to have this slideshow widget show only on the blog page.

    Here is my functions.php code:

    ‘/** Register widget areas */
    genesis_register_sidebar( array(
    ‘id’    => ‘welcome-text’,
    ‘name’    => __( ‘Welcome Text’, ‘genesis’ ),
    ‘description’    => __( ‘This is the welcome text widget.’, ‘themename’ ),
    ) );

    /** Add the welcome text section */
    add_action( ‘genesis_before_loop’, ‘custom_welcome_text’ );
    function custom_welcome_text() {
    genesis_widget_area( ‘welcome-text’, array(
    ‘before’ => ‘<div class=”welcome-text widget-area”>’,
    ) );
    }’

    Thanks for your help.

    Julie

    #25605

    braddalton
    Participant
    Post count: 8853

    Add a conditional tag for your blog page template.
    [php]
    add_action( ‘genesis_before_loop’, ‘child_before_content’);
    function child_before_content() {
    if ( is_page_template(‘blog.php’) ) {
    echo ‘<div id="welcome-text">’;
    dynamic_sidebar( ‘welcome-text’ );
    echo ‘</div><!– end #welcome-text –>’;
    }

    }
    [/php]

    You can use the page i.d or page template with your conditional tag. http://codex.wordpress.org/Conditional_Tags#Is_a_Page_Template
    [html]
    page-id-148 page-template-page_blog-php
    [/html]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

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

You must be logged in to reply to this topic.