Community Forums › Forums › Archived Forums › Design Tips and Tricks › Remove static page/posts section from Front Page of Streamline Pro
Tagged: font page, remove, streamline pro
- This topic has 5 replies, 2 voices, and was last updated 7 years, 11 months ago by Tal.
-
AuthorPosts
-
December 13, 2016 at 8:39 am #197512TalMember
I've added a couple of extra widget areas and would like to remove the static page/posts section and sidebar from the home page in Streamline Pro - basically anything that should appear in the "site-inner" container.
This could be done using remove_action in the functions file right? But I need some help in how to code it.
Thanks
December 13, 2016 at 11:55 am #197521Victor FontModeratorFor the home page, you would edit front-page.php. You can put your remove actions in there or just delete the code you don't want.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?December 13, 2016 at 12:01 pm #197522TalMemberI did look but couldn't find anything that was obvious to me as relating to the part I wanted to remove...
<?php /** * This file adds the Home Page to the Streamline Pro Theme. * * @author StudioPress * @package Streamline Pro * @subpackage Customizations */ add_action( 'genesis_meta', 'streamline_home_genesis_meta' ); /** * Add widget support for homepage. If no widgets active, display the default loop. * */ function streamline_home_genesis_meta() { if ( is_active_sidebar( 'home-featured-1' ) || is_active_sidebar( 'home-featured-2' ) || is_active_sidebar( 'home-featured-3' ) ) { //* Force content-sidebar layout setting add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' ); // Add streamline-pro-home body class add_filter( 'body_class', 'streamline_body_class' ); // Add homepage widgets add_action( 'genesis_before_content_sidebar_wrap', 'streamline_homepage_widgets' ); } } function streamline_body_class( $classes ) { $classes[] = 'streamline-pro-home'; return $classes; } function streamline_homepage_widgets() { if ( is_active_sidebar( 'home-featured-1' ) || is_active_sidebar( 'home-featured-2' ) || is_active_sidebar( 'home-featured-3' ) ) { echo '<div class="home-featured">'; genesis_widget_area( 'home-featured-1', array( 'before' => '<div class="home-featured-1 widget-area">', 'after' => '</div>', ) ); genesis_widget_area( 'home-featured-2', array( 'before' => '<div class="home-featured-2 widget-area">', 'after' => '</div>', ) ); genesis_widget_area( 'home-featured-3', array( 'before' => '<div class="home-featured-3 widget-area">', 'after' => '</div>', ) ); echo '</div><!-- end #home-featured -->'; } } genesis();
December 13, 2016 at 12:29 pm #197525Victor FontModeratorYou'll need to edit one line and add another.
Change this line:
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
to
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
Then, in the same function, add:
//* Remove the default Genesis loop remove_action( 'genesis_loop', 'genesis_do_loop' );
The first change gets rid of the sidebar. The second removes the posts.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?December 13, 2016 at 12:48 pm #197530TalMemberThanks.
I don't know why, but that doesn't change anything.December 13, 2016 at 12:55 pm #197532TalMemberI moved both those outside of that function and it works, thanks
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.