Remove bottom section from home page?

Community Forums Forums Design Tips and Tricks Remove bottom section from home page?

This topic is: resolved

Tagged: 

This topic contains 18 replies, has 2 voices, and was last updated by  braddalton 1 year, 5 months ago.

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #21770

    volvox
    Participant
    Post count: 10

    Hello – Here the home.php from the corporate theme – how can i remove the bottom section widget 1, 2 and 3 from showing on the page – and only on the home page

    <?php
    add_action( ‘genesis_meta’, ‘corporate_home_genesis_meta’ );
    /**
    * Add widget support for homepage. If no widgets active, display the default loop.
    *
    */
    function corporate_home_genesis_meta() {
    if ( is_active_sidebar( ‘featured’ ) || is_active_sidebar( ‘home-middle-1′ ) || is_active_sidebar( ‘home-middle-2′ ) || is_active_sidebar( ‘home-middle-3′ ) ) {
    remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );
    add_action( ‘genesis_loop’, ‘corporate_home_loop_helper’ );
    add_filter( ‘genesis_pre_get_option_site_layout’, ‘__genesis_return_full_width_content’ );
    }
    }

    /**
    * Display widget content for “featured” and “home-middle” sections
    *
    */
    function corporate_home_loop_helper() {

    echo ‘<div id=”featured”><div class=”wrap”>’;
    dynamic_sidebar( ‘featured’ );
    echo ‘</div></div><!– end #featured –>’;
    echo ‘<div id=”home-middle”><div class=”wrap”>’;

    if ( is_active_sidebar( ‘home-middle-1′ ) ) {
    echo ‘<div class=”home-middle-1″>’;
    dynamic_sidebar( ‘home-middle-1′ );
    echo ‘</div><!– end .home-middle-1 –>’;
    }

    if ( is_active_sidebar( ‘home-middle-2′ ) ) {
    echo ‘<div class=”home-middle-2″>’;
    dynamic_sidebar( ‘home-middle-2′ );
    echo ‘</div><!– end .home-middle-2 –>’;
    }

    if ( is_active_sidebar( ‘home-middle-3′ ) ) {
    echo ‘<div class=”home-middle-3″>’;
    dynamic_sidebar( ‘home-middle-3′ );
    echo ‘</div><!– end .home-middle-3 –>’;
    }

    echo ‘</div></div><!– end #home-bottom –>’;
    }

    genesis();

    Thanks

     

    #21945

    braddalton
    Participant
    Post count: 8876

    [php]
    add_action(‘get_footer’, ‘child_remove_genesis_do_footer’);
    function child_remove_genesis_do_footer() {
    if (is_home()) {
    remove_action(‘genesis_footer’, ‘genesis_do_footer’);
    remove_action(‘genesis_footer’, ‘genesis_footer_markup_open’, 5);
    remove_action(‘genesis_footer’, ‘genesis_footer_markup_close’, 15);
    }
    }
    [/php]

    Add this to your child themes functions.php file


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #22366

    volvox
    Participant
    Post count: 10

    Hello – thanks…  the above code does’nt do it!  Adding the code to the function.php file gives me an error ( blank page).

    And this is the home-bottom section i want to remove from the home page – not the footer.  There are three home-bottom sections (1,2,3), similar to the home-middle sections.

     

     

    #22372

    braddalton
    Participant
    Post count: 8876

    This will hide the home-middle widgets from displaying.
    [css]
    #home-middle {
    display: none;
    }
    [/css]

    Maybe you have some custom coding for home-bottom as i couldn’t see it on the functions.php or widgets page.

    You could trying something like this:
    [css]
    #home-bottom {
    display: none;
    }
    [/css]
    As long as the selector is the same as #home-bottom which you can inspect using the Firebug addon.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #22383

    volvox
    Participant
    Post count: 10

    Thanks….

    The tag is footer-widgets

    Since i want to touch the the home page only  (so the CSS trick can’t be applied) i came back with your first suggestion editing the function, but still get error!

    Here the whole original function.php file:

     

    <?php
    /** Start the engine */
    require_once( TEMPLATEPATH . ‘/lib/init.php’ );

    /** Child theme (do not remove) */
    define( ‘CHILD_THEME_NAME’, ‘Corporate Theme’ );
    define( ‘CHILD_THEME_URL’, ‘http://www.studiopress.com/themes/corporate’ );

    $content_width = apply_filters( ‘content_width’, 620, 450, 930 );

    /** Add new image sizes */
    add_image_size( ‘featured’, 500, 240, TRUE );
    add_image_size( ‘home-middle’, 275, 100, TRUE );

    /** Add suport for custom background */
    add_custom_background();

    /** Add support for custom header */
    add_theme_support( ‘genesis-custom-header’, array( ‘width’ => 960, ‘height’ => 130, ‘textcolor’ => ‘ffffff’, ‘admin_header_callback’ => ‘corporate_admin_style’ ) );

    /**
    * Register a custom admin callback to display the custom header preview with the
    * same style as is shown on the front end.
    *
    */
    function corporate_admin_style() {

    $headimg = sprintf( ‘.appearance_page_custom-header #headimg { background: url(%s) no-repeat; font-family: Droid Sans, arial, serif; min-height: %spx; text-shadow: #000 1px 1px; }’, get_header_image(), HEADER_IMAGE_HEIGHT );
    $h1 = sprintf( ‘#headimg h1, #headimg h1 a { color: #%s; font-size: 30px; font-weight: normal; line-height: 30px; margin: 40px 0 0 15px; text-decoration: none; }’, esc_html( get_header_textcolor() ) );
    $desc = sprintf( ‘#headimg #desc { color: #%s; font-size: 16px; line-height: 1; margin: 10px 0 0 30px; }’, esc_html( get_header_textcolor() ) );

    printf( ‘<style type=”text/css”>%1$s %2$s %3$s</style>’, $headimg, $h1, $desc );

    }

    /** Change breadcrumb location */
    remove_action( ‘genesis_before_loop’, ‘genesis_do_breadcrumbs’ );
    add_action( ‘genesis_after_header’, ‘genesis_do_breadcrumbs’ );

    /** Add support for 3-column footer widgets */
    add_theme_support( ‘genesis-footer-widgets’, 3 );

    /** Register widget areas */
    genesis_register_sidebar( array(
    ‘id’            => ‘featured’,
    ‘name’            => __( ‘Featured’, ‘corporate’ ),
    ‘description’    => __( ‘This is the featured section.’, ‘corporate’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’            => ‘home-middle-1′,
    ‘name’            => __( ‘Home Middle #1′, ‘corporate’ ),
    ‘description’    => __( ‘This is the home middle #1 section.’, ‘corporate’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’            => ‘home-middle-2′,
    ‘name’            => __( ‘Home Middle #2′, ‘corporate’ ),
    ‘description’    => __( ‘This is the home middle #2 section.’, ‘corporate’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’            => ‘home-middle-3′,
    ‘name’            => __( ‘Home Middle #3′, ‘corporate’ ),
    ‘description’    => __( ‘This is the home middle #3 section.’, ‘corporate’ ),
    ) );
    ?>

     

     

     

     

    #22385

    volvox
    Participant
    Post count: 10

    And for reference  here is the page.

    Thanks

    #22388

    braddalton
    Participant
    Post count: 8876

    .home is the class selector
    #footer-widgets is the i.d selector

    Here’s the new rule to hide your footer widgets using CSS
    [css]
    .home #footer-widgets {
    display: none;
    }
    [/css]

    Add it to the end of your child themes style.css file

    Display:none is your declaration which consists of a property and value
    display is the property
    none is the value

    Further learning
    1. http://www.w3schools.com/css/css_id_class.asp
    2. http://www.htmldog.com/guides/cssintermediate/classid/

    You can also use PHP code to remove footer widgets on specific pages using conditional tags example: is_home()

    Another option is to install the Widget Logic plugin and add a conditional tag to each footer widget.

    Example: !is_home() which will hide the widgets from displaying on the home page only

    ref: http://codex.wordpress.org/Conditional_Tags


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #22402

    volvox
    Participant
    Post count: 10

    Nice – thanks a lot for hints and references – very useful

    I have used the CSS rule but will also try the function.

     

     

     

     

     

     

    #22871

    volvox
    Participant
    Post count: 10

    Hello – i reopen the post for another related question

    Here i want to remove the footer-widgets sections from an archive template page i have done.

    Obviously a trick like

    .archive #footer-widgets {
    display: none;
    }

    does not work!

    In fact, what is the conditional tag name for this custom archive page i have created ?
    (Template Name is  ‘Category Archive’, File name is ‘page-catarchive.php’.

    Thanks

    #22874

    braddalton
    Participant
    Post count: 8876

    [php]
    is_page_template (‘page-catarchive.php’)
    [/php]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #22877

    volvox
    Participant
    Post count: 10

    OK thanks.

    then i’m back to the removing function … such as

    add_action('get_footer-widgets', 'child_remove_genesis_do_footer-widgets');
    function child_remove_genesis_do_footer-widgets() {
    if (is_page_template(page-catarchive.php)) {
    remove_action('genesis_footer-widgets', 'genesis_do_footer-widgets');
    }
    }

    with no success !

    (page for which the 3 footer-widgets must be removed is:  http://volvoxsoft.com/calendrier/)

    #22880

    braddalton
    Participant
    Post count: 8876

    [css]
    .page-id-1916 #footer-widgets {
    display: none;
    }
    [/css]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #22883

    volvox
    Participant
    Post count: 10

    Great – i have much to learn!

    Thanks

    #22885

    volvox
    Participant
    Post count: 10

    By the way – which way is better in order to remove/hide  widgets from specific page?

    - CSS (hide) or a function ?

     

    #22886

    braddalton
    Participant
    Post count: 8876

    A suggestion if i may Volvox.

    Try installing the Firebug addon for Firefox and learning the basics of CSS http://www.w3schools.com/css/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

Viewing 15 posts - 1 through 15 (of 19 total)

You must be logged in to reply to this topic.