Community Forums › Forums › Archived Forums › Design Tips and Tricks › Removing the blog posts from the homepage on Education Pro
Tagged: genesis loop, remove loop
- This topic has 6 replies, 2 voices, and was last updated 7 years ago by Brad Dalton.
-
AuthorPosts
-
March 14, 2017 at 11:00 pm #203121coolgrooveParticipant
Hi there,
I would like to completely remove the automatically displayed blog posts under the home-middle section on the homepage on the Education pro theme. Since I don't understand a line of coding, I already asked the support about that and they gave me this code:
//* Remove the default Genesis loop
remove_action( 'genesis_loop', 'genesis_do_loop' );//* Unregister primary sidebar
unregister_sidebar( 'sidebar' );and told me to add this code to my theme's front-page.php file
So I found the said front.page.php fiel and it looks like that:
<?php
/**
* This file adds the Home Page to the Education Pro Theme.
*
* @author StudioPress
* @package Education Pro
* @subpackage Customizations
*/add_action( 'genesis_meta', 'education_home_genesis_meta' );
/**
* Add widget support for homepage. If no widgets active, display the default loop.
*
*/
function education_home_genesis_meta() {global $paged;
if( $paged < 1 ) {
if ( is_active_sidebar( 'home-featured' ) || is_active_sidebar( 'home-top' ) || is_active_sidebar( 'home-middle' ) ) {
//* Add education-pro-home body class
add_filter( 'body_class', 'education_body_class' );//* Remove breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );//* Add home top widgets
add_action( 'genesis_after_header', 'education_home_top_widgets' );}
}
if ( is_active_sidebar( 'home-bottom' ) ) {
//* Add home bottom widgets
add_action( 'genesis_before_footer', 'education_home_bottom_widgets', 1 );}
}
function education_body_class( $classes ) {
$classes[] = 'education-pro-home';
return $classes;}
function education_home_top_widgets() {
genesis_widget_area( 'home-featured', array(
'before' => '<div class="home-featured widget-area">',
'after' => '</div>',
) );So where EXACTLY should I add the code? I'd really appreciate someone helping me with advice, since I don't want to risk a “white screen of death" for our music school's website.
http://www.musikwerkstatt-weingarten.de
Thank you all!
Kind regards,
http://www.musikwerkstatt-weingarten.de
ClaudiuMarch 15, 2017 at 4:18 am #203130Brad DaltonParticipantUntested but try adding it after the opening <?php tag and see what happens.
Make sure you use a code editor and FTP or File Manager in cPanel.
March 17, 2017 at 12:39 am #203218Brad DaltonParticipantMarch 17, 2017 at 12:47 am #203220coolgrooveParticipantHi Brad,
sorry for not getting back to you and thanks for your help.
Actually the support guys told me to add those lines after:
add_filter( 'body_class', 'education_body_class' );
and THIS did fix the problem 🙂
Thanks again for your help.
Best,
ClaudiuMarch 17, 2017 at 12:49 am #203221Brad DaltonParticipantI was referring to removing the loop of blog posts not the body class.
March 17, 2017 at 3:19 am #203222coolgrooveParticipantOh... Sorry for the noob question, but what's the difference? I mean, would it be better to remove the loop of blog posts instead ? Right now the blog post section below Home-Middle is gone and this is what I wanted in first place. Maybe I'm gonna give your suggestion a try ...
Thanks again
Best,
ClaudiuMarch 17, 2017 at 4:25 am #203226Brad DaltonParticipant -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.