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 2 years, 8 months ago.

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



    I am working on this website:

    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.




    Add a conditional tag for your blog page template.

    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 –>';

    You can use the page i.d or page template with your conditional tag.

    page-id-148 page-template-page_blog-php

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

You must be logged in to reply to this topic.