Community Forums › Forums › General Discussion › Mocha theme totally widgetize home page
Tagged: Mocha theme
This topic contains 30 replies, has 4 voices, and was last updated by PinkInk 3 months, 2 weeks ago.
-
AuthorPosts
-
February 5, 2013 at 8:23 pm #18364
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
February 7, 2013 at 4:52 pm #18773Am I asking a silly question? would love some direction here.
Tiff
February 7, 2013 at 6:45 pm #18800Hi, 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’d love to customize your website! I tweet!
I’ve taken up the challenge! – help me answer some of the unanswered postsFebruary 7, 2013 at 6:56 pm #18805Hi 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
February 7, 2013 at 7:00 pm #18806Can you please post a link to your site, so that I can look at your code?
Susan @ Graphically Designing I’d love to customize your website! I tweet!
I’ve taken up the challenge! – help me answer some of the unanswered postsFebruary 7, 2013 at 7:01 pm #18807Would 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
February 7, 2013 at 7:03 pm #18808my site is in maintenance mode while under construction would you like me to send you the link and password?
Tiff
February 7, 2013 at 7:16 pm #18813This reply has been marked as private.
Twitter Handles: @thecre8tivediva | Website: Cre8tiveDiva.com | LinkedIn Group: http://goo.gl/nNe1m
Why Not Take The Challenge! – Help us answer some of the unanswered postsFebruary 7, 2013 at 7:27 pm #18816This reply has been marked as private.
Tiff
February 7, 2013 at 7:36 pm #18819Do you want the sidebars on the inside pages or are you wanting to remove them all together?
Twitter Handles: @thecre8tivediva | Website: Cre8tiveDiva.com | LinkedIn Group: http://goo.gl/nNe1m
Why Not Take The Challenge! – Help us answer some of the unanswered postsFebruary 7, 2013 at 7:43 pm #18820Here is the code to remove the sidebar on the home only. Add this to the bottom of your functions.php file.
// 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'); } }
Twitter Handles: @thecre8tivediva | Website: Cre8tiveDiva.com | LinkedIn Group: http://goo.gl/nNe1m
Why Not Take The Challenge! – Help us answer some of the unanswered postsFebruary 7, 2013 at 7:49 pm #18821Hi 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
February 7, 2013 at 8:16 pm #18827Hi,
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
February 7, 2013 at 8:29 pm #18828
<?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
February 7, 2013 at 8:31 pm #18829the 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
-
AuthorPosts
The topic ‘Mocha theme totally widgetize home page’ is closed to new replies.