Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #15725

    Hi, would like to hide the footer from certain pages (home page, portfolio, etc.) I’m not a PHP guy (long time ASP.NET, cough), so any tips are appreciated. Think I need to add a check on the footer.php file for the page IDs and the hide the footer with dynamic CSS or just an “if” block?

    Thanks!

    #88768

    Hi,

    Open page.php, and find the code <?php get_footer(); ?>. You can use simple wordpress conditionals that you can find here. http://codex.wordpress.org/Function_Reference/is_page. Example is.

    <?php if ( is_home() ) {
    get_footer();
    }
    ?>

    Regards,

    Ismael

    #88769

    In footer.php replace:

    <!-- ####### FOOTER CONTAINER ####### -->
    <div class='container_wrap <?php echo $extraClass; ?>' id='footer'>
    <div class='container'>

    <?php
    //create the footer columns by iterating
    $columns = avia_get_option('footer_columns');

    $firstCol = 'first';
    switch($columns)
    {
    case 1: $class = ''; break;
    case 2: $class = 'one_half'; break;
    case 3: $class = 'one_third'; break;
    case 4: $class = 'one_fourth'; break;
    case 5: $class = 'one_fifth'; break;
    }

    //display the footer widget that was defined at appearenace->widgets in the wordpress backend
    //if no widget is defined display a dummy widget, located at the bottom of includes/register-widget-area.php
    for ($i = 1; $i <= $columns; $i++)
    {
    echo "<div class='$class $firstCol'>";
    if (function_exists('dynamic_sidebar') && dynamic_sidebar('Footer - column'.$i) ) : else : avia_dummy_widget($i); endif;
    echo "</div>";
    $firstCol = "";
    }

    ?>

    </div>

    </div>
    <!-- ####### END FOOTER CONTAINER ####### -->

    <!-- ####### SOCKET CONTAINER ####### -->
    <div class='container_wrap <?php echo $extraClass; ?>' id='socket'>
    <div class='container'>
    <span class='copyright'>&copy; <?php _e('Copyright','avia_framework'); ?> - <a href='<?php echo home_url('/'); ?>'><?php echo get_bloginfo('name');?></a> - <a href='http://www.kriesi.at'>Wordpress Theme by Kriesi.at</a></span>

    <ul class="social_bookmarks">
    <?php
    do_action('avia_add_social_icon','footer');
    //contact icon
    $contact_page_id = avia_get_option('email_page');
    if (function_exists('icl_object_id')) $contact_page_id = icl_object_id($contact_page_id, 'page', true); //wpml prepared
    if($contact_page_id) echo "<li class='mail'><a href='".get_permalink($contact_page_id)."'>".__('Send us Mail', 'avia_framework')."</a></li>";

    if($dribbble = avia_get_option('dribbble')) echo "<li class='dribbble'><a href='http://dribbble.com/".$dribbble."'>".__('Follow us on dribbble', 'avia_framework')."</a></li>";
    if($twitter = avia_get_option('twitter')) echo "<li class='twitter'><a href='http://twitter.com/".$twitter."'>".__('Follow us on Twitter', 'avia_framework')."</a></li>";
    if($facebook = avia_get_option('facebook')) echo "<li class='facebook'><a href='".$facebook."'>".__('Join our Facebook Group', 'avia_framework')."</a></li>";

    ?>

    <li class='rss'><a href="<?php avia_option('feedburner',get_bloginfo('rss2_url')); ?>"><?php _e('Subscribe to our RSS Feed', 'avia_framework')?></a></li>

    </ul>
    <!-- end social_bookmarks-->

    </div>
    </div>
    <!-- ####### END SOCKET CONTAINER ####### -->

    with:

    <?php if( !is_page(array(42,54,6)) ) { ?>
    <!-- ####### FOOTER CONTAINER ####### -->
    <div class='container_wrap <?php echo $extraClass; ?>' id='footer'>
    <div class='container'>

    <?php
    //create the footer columns by iterating
    $columns = avia_get_option('footer_columns');

    $firstCol = 'first';
    switch($columns)
    {
    case 1: $class = ''; break;
    case 2: $class = 'one_half'; break;
    case 3: $class = 'one_third'; break;
    case 4: $class = 'one_fourth'; break;
    case 5: $class = 'one_fifth'; break;
    }

    //display the footer widget that was defined at appearenace->widgets in the wordpress backend
    //if no widget is defined display a dummy widget, located at the bottom of includes/register-widget-area.php
    for ($i = 1; $i <= $columns; $i++)
    {
    echo "<div class='$class $firstCol'>";
    if (function_exists('dynamic_sidebar') && dynamic_sidebar('Footer - column'.$i) ) : else : avia_dummy_widget($i); endif;
    echo "</div>";
    $firstCol = "";
    }

    ?>

    </div>

    </div>
    <!-- ####### END FOOTER CONTAINER ####### -->

    <!-- ####### SOCKET CONTAINER ####### -->
    <div class='container_wrap <?php echo $extraClass; ?>' id='socket'>
    <div class='container'>
    <span class='copyright'>&copy; <?php _e('Copyright','avia_framework'); ?> - <a href='<?php echo home_url('/'); ?>'><?php echo get_bloginfo('name');?></a> - <a href='http://www.kriesi.at'>Wordpress Theme by Kriesi.at</a></span>

    <ul class="social_bookmarks">
    <?php
    do_action('avia_add_social_icon','footer');
    //contact icon
    $contact_page_id = avia_get_option('email_page');
    if (function_exists('icl_object_id')) $contact_page_id = icl_object_id($contact_page_id, 'page', true); //wpml prepared
    if($contact_page_id) echo "<li class='mail'><a href='".get_permalink($contact_page_id)."'>".__('Send us Mail', 'avia_framework')."</a></li>";

    if($dribbble = avia_get_option('dribbble')) echo "<li class='dribbble'><a href='http://dribbble.com/".$dribbble."'>".__('Follow us on dribbble', 'avia_framework')."</a></li>";
    if($twitter = avia_get_option('twitter')) echo "<li class='twitter'><a href='http://twitter.com/".$twitter."'>".__('Follow us on Twitter', 'avia_framework')."</a></li>";
    if($facebook = avia_get_option('facebook')) echo "<li class='facebook'><a href='".$facebook."'>".__('Join our Facebook Group', 'avia_framework')."</a></li>";

    ?>

    <li class='rss'><a href="<?php avia_option('feedburner',get_bloginfo('rss2_url')); ?>"><?php _e('Subscribe to our RSS Feed', 'avia_framework')?></a></li>

    </ul>
    <!-- end social_bookmarks-->

    </div>
    </div>
    <!-- ####### END SOCKET CONTAINER ####### -->
    <?php } ?>

    and instead of 42,54,6 enter the ids of the pages you want to exclude (remove the footer from).

    #88770

    Thanks Ismael and Dude!!

    #88771

    Glad they could help get that solved for you :)

    Regards,

    Devin

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

The topic ‘Need to hide the footer from certain pages in Choices.’ is closed to new replies.