Support » Fixing WordPress » Conditional Statement to post a widget into a specific page

  • I’m having a trouble with my code.

    Basically, I want a specific widget (Sidebar) to appear in a specific page and a widget that will appear to the rest of the pages except home page.

    <?php if(is_page(4)):?>
    	<?php
            // A series of widgets posted in specific page.
            if ( is_active_sidebar( 'primary-widget-area','about-us','careers','news','contact-us','local' ) ) : ?>
    
                    <div class="side_navigation widget-area" id="secondary" role="complementary">
                        <ul class="parent">
    
                             <?php dynamic_sidebar( 'about-us' ); ?>
    
                             <?php /*?><?php if(is_page(6)):?>
                                <?php dynamic_sidebar( 'services' ); ?>
                             <?php endif;?>
                             <?php if(is_page(8)):?>
                                <?php dynamic_sidebar( 'careers' ); ?>
                             <?php endif;?>
                             <?php if(is_page(10)):?>
                                <?php dynamic_sidebar( 'news' ); ?>
                             <?php endif;?>
                             <?php if(is_page(12)):?>
                                <?php dynamic_sidebar( 'contact-us' ); ?>
                             <?php endif;?>
    
                             <?php if(!is_front_page()):?>
                                <?php dynamic_sidebar( 'local' ); ?>
                             <?php endif;?><?php */?>
                        </ul>
                    </div>
                    <!-- ABOUT US .widget-area -->
    
    <?php endif;?>

    It doesn’t let me show 🙁

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conditional Statement to post a widget into a specific page’ is closed to new replies.