Community Forums › Forums › Archived Forums › Design Tips and Tricks › Remove Blog from homepage
- This topic has 10 replies, 3 voices, and was last updated 8 years, 9 months ago by
tigaruk.
-
AuthorPosts
-
March 28, 2016 at 4:56 pm #182403
tigaruk
MemberIm using the Modern Studio Pro Theme.
All i want to do is remove the blog posts from the homepage. I found this code which works BUT it also removes the post content from the actual posts themselves which isn't helpful.
/** Removing Blog Post From Home Page */ remove_action( 'genesis_loop', 'genesis_do_loop' );add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
March 29, 2016 at 8:49 am #182448Brad Dalton
ParticipantDo you want toi remove the post content or the blog posts rom the home page as both as the same thing?
The first snippet removes the posts and the 2nd forces a full width layout removing the sidebar.
March 29, 2016 at 9:25 am #182457tigaruk
MemberI just want to remove the blog posts from the home page. If i use just the first snippet it removes the blog posts from the homepage but also removes the post content from the actual posts themselves, so a post is actually blank.
March 29, 2016 at 9:31 am #182459Brad Dalton
ParticipantYou need to use the code with the
is_front_page()
conditional tag or create a
front-page.php
file and add the code to the file so it only executes on the front page.
March 29, 2016 at 10:53 am #182467tigaruk
MemberThanks, but i've never done conditional stuff before so not sure how to do that.
I tried
if ( is_front_page() ) { remove_action( 'genesis_loop', 'genesis_do_loop' ); } }
Which just broke the site :/
March 30, 2016 at 8:15 am #182522tigaruk
MemberThis is driving me mad, despite millions of people asking this question on google. No one has the correct answer and every answer they do have is totally different to someone elses and is written in the vaguest of terms. I even tried a plugin to remove the posts which instead filled it with a line of text saying 'Sorry, no content matched your criteria.' Which again seems impossible to remove without removing every post on the site.
Surely there is a simple solution to this to hide, remove or destroy all blog posts from showing on the home page.
April 2, 2016 at 12:14 pm #182762tigaruk
MemberAnyone know how to do this please?
April 2, 2016 at 3:40 pm #182767Victor Font
ModeratorModern Studio Pro is one of those rare themes that doesn't have a front-page.php. As Brad advised in an earlier post, you'll have to create one and add the code there. As alternatives, you could use a static front page, or finally, since the theme doesn't have a front-page.php, for the conditional you could try if ( is_front_page() || is_home() ).
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?April 24, 2016 at 4:39 am #184305tigaruk
MemberThanks, my issue is i don't know how to do conditional stuff, or at least what im trying is slightly wrong somewhere and i can't just find the right way to write that line of code.
April 24, 2016 at 6:00 am #184311Victor Font
Moderatorif ( is_front_page() || is_home() ) { remove_action( 'genesis_loop', 'genesis_do_loop' ); }
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?June 8, 2016 at 8:09 am #187172tigaruk
MemberThanks for the reply, but that code isn't removing the posts from the home page 🙁
I've placed it in functions.php like i should and nothing changes.Really don't know why or what to do.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.