Mocha theme totally widgetize home page

Community Forums Forums General Discussion Mocha theme totally widgetize home page

This topic is: resolved

Tagged: 

This topic contains 30 replies, has 4 voices, and was last updated by  PinkInk 1 year, 8 months ago.

Viewing 15 posts - 1 through 15 (of 31 total)
  • Author
    Posts
  • #18364

    PinkInk
    Participant
    Post count: 23

    Hi I am using the Mocha theme and I am attempting to totally widgetize my home page. No posts and no sidebar or content, just widgets.

    I’ve registered my home widgets and all is working fine but I can’t seem to work out how to remove the posts, content and sidebar area on the home page only?

    I’ve noticed on the landing page.php there is a remove_action for header, nav and footer should I be adding something similar to the home.php page to remove the content_sidebar? Plus removing the grid loop as well?

     


    Tiff

    #18773

    PinkInk
    Participant
    Post count: 23

    Am I asking a silly question? would love some direction here.


    Tiff

    #18800

    Susan
    Moderator
    Post count: 9253

    Hi, Tiff:

    No, it’s not a silly question.

    The mocha theme by default is set up like a blog, and will display your latest posts by default. Have you considered setting a static page as your home page? That might be the easiest way to have it set up, if you have no intention of showing posts on the page.

    As for the sidebar, if you go to Genesis > Theme Settings > Default Layout, and select full width layout, your sidebars will disappear.


    Susan @ Graphically Designing I offer theme customizations I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

    #18805

    PinkInk
    Participant
    Post count: 23

    Hi Susan, thank you so much for you reply, I really appreciate it.

    With regards to the home page, I understand the static page which I think I may have to do anyway but it still leaves me with the content and sidebar (or full content), I actually want to remove (or hide using display:none; in the CSS if necessary) the .content_sidebar, #content_sidebar_wrap etc form the home page only so that just the widgets display.

    Is that making any sense? sorry for not being very clear.


    Tiff

    #18806

    Susan
    Moderator
    Post count: 9253

    Can you please post a link to your site, so that I can look at your code?


    Susan @ Graphically Designing I offer theme customizations I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

    #18807

    PinkInk
    Participant
    Post count: 23

    Would forcing a layout like this in the home.php page
    genesis_set_default_layout( 'custom_layout' );

    then adding bellow to my CSS work?

    .custom_layout{
    display:none;
    }


    Tiff

    #18808

    PinkInk
    Participant
    Post count: 23

    my site is in maintenance mode while under construction would you like me to send you the link and password?


    Tiff

    #18813

    AC
    Blocked
    Post count: 7712
    This reply has been marked as private.
    #18816

    PinkInk
    Participant
    Post count: 23
    This reply has been marked as private.
    #18819

    AC
    Blocked
    Post count: 7712

    Do you want the sidebars on the inside pages or are you wanting to remove them all together?

    #18820

    AC
    Blocked
    Post count: 7712

    Here is the code to remove the sidebar on the home only. Add this to the bottom of your functions.php file.

    [php]// remove sidebar from home
    add_action (‘genesis_before_loop’, ‘remove_sidebar_home’);
    function remove_sidebar_home() {
    if (is_home() ) {
    remove_action (‘genesis_after_content’,’genesis_get_sidebar’);
    }
    }[/php]

    #18821

    PinkInk
    Participant
    Post count: 23

    Hi Anitac, thank you so much! yes trying to remove the sidebar and content from home page only.
    that worked to remove my sidebar however the content is still there.


    Tiff

    #18827

    Hard Boiled Greg
    Participant
    Post count: 88

    Hi,

    I’d like to help. Just so I can get caught up, are you using a home.php file? If you are, would you mind posting what is in there now?

    Thanks,

    HBG


    Website: Hard Boiled Greg Twitter: @hbgreg

    #18828

    PinkInk
    Participant
    Post count: 23


    <?php

    /** Add home slider */
    add_action( ‘genesis_before_content_sidebar_wrap’, ‘custom_welcome_text’ );
    function custom_welcome_text() {
    genesis_widget_area( ‘home-slider’, array(
    ‘before’ => ‘<div class=”home-slider”>’,
    ) );
    }

    /** Add the home content section */
    add_action( ‘genesis_before_content_sidebar_wrap’, ‘mocha_home_content’ );
    function mocha_home_content() {

    /** Do nothing on page 2 or greater */
    if ( get_query_var( ‘paged’ ) >= 2 )
    return;

    genesis_widget_area( ‘home-content’, array(
    ‘before’ => ‘<div class=”home-content widget-area”>’,
    ) );

    }

    // remove sidebar from home
    add_action (‘genesis_before_loop’, ‘remove_sidebar_home’);
    function remove_sidebar_home() {
    if (is_home() ) {
    remove_action (‘genesis_after_content’,’genesis_get_sidebar’);
    }
    }
    // remove content from home
    add_action (‘genesis_before_loop’, ‘remove_content_home’);
    function remove_content_home() {
    if (is_home() ) {
    remove_action (‘genesis_after_content’,’genesis_get_content’);
    }
    }
    remove_action( ‘genesis_before_loop’, ‘genesis_do_breadcrumbs’);
    remove_action( ‘genesis_sidebar’, ‘genesis_do_sidebar’ );
    remove_action( ‘genesis_content_sidebar’, ‘genesis_do_content_sidebar’);
    remove_action( ‘genesis_content_sidebar_wrap’, ‘genesis_do_content_sidebar_wrap’);

    genesis();

     


    Tiff

    #18829

    PinkInk
    Participant
    Post count: 23

    the bottom sections were just me trying anything out but they haven’t worked so I’m removing
    // remove content from home
    add_action ('genesis_before_loop', 'remove_content_home');
    function remove_content_home() {
    if (is_home() ) {
    remove_action ('genesis_after_content','genesis_get_content');
    }
    }
    remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs');
    remove_action( ‘genesis_sidebar’, ‘genesis_do_sidebar’ );
    remove_action( 'genesis_content_sidebar', 'genesis_do_content_sidebar');
    remove_action( 'genesis_content_sidebar_wrap', 'genesis_do_content_sidebar_wrap');


    Tiff

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

The topic ‘Mocha theme totally widgetize home page’ is closed to new replies.