Community Forums › Forums › Archived Forums › Design Tips and Tricks › Divine Theme – do not display blog posts
Tagged: Divine pro
- This topic has 5 replies, 2 voices, and was last updated 6 years, 9 months ago by Brad Dalton.
-
AuthorPosts
-
July 16, 2017 at 7:14 pm #209194brankicaMember
Divine theme home page is set up with a lot of widgets.
If a static page is selected for the home page, all widgets are gone.I want to use the "Before Content" widget as is, to display three featured posts. I would not fill the other widgets so the home page would display just the three image-links.
But the home page, of course, automatically displays blog posts, best case scenario I can limit it to one but I don't want to display any of them.
I looked up tutorials online, some recommend adding
remove_action( 'genesis_loop', 'genesis_do_loop' );
but when I added it to the theme's functions.php it removes content from each post and page on the site.I understand this code would do what I need, but I don't know where exactly to put it and how to "make a condition" or edit the code so it excludes the blog posts from home page only.
I tried using this tutorial but I don't know how to implement it
wpsites.net/web-design/remove-posts-display-home-page/July 16, 2017 at 8:07 pm #209196Brad DaltonParticipantDid you try leaving the Reading settings to display your latest posts and then populating the widget area with the Genesis featured posts widget?
I doubt you need to add any code unless your home or front page is coded to display both widgets and a loop of posts.
Also, i don't have access to your theme to test my solution.
July 16, 2017 at 8:10 pm #209197brankicaMemberYes, the page is made to display both the widgets (actually more than just the featured post ones) and the posts as a "regular" theme would. And yes I tried that.
July 16, 2017 at 8:20 pm #209198Brad DaltonParticipantModify the front-page.php file to this:
<?php /** * Divine. * * @package Divine * @link http://restored316designs.com/themes * @author Lauren Gaige // Restored 316 LLC * @copyright Copyright (c) 2015, Restored 316 LLC, Released 3/11/2015 * @license GPL-2.0+ */ remove_action( 'genesis_loop', 'genesis_do_loop' ); add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' ); add_filter( 'body_class', 'divine_add_home_body_class' ); function divine_add_home_body_class( $classes ) { $classes[] = 'divine-home'; return $classes; } genesis();
July 17, 2017 at 6:45 am #209206brankicaMemberThis is what is in it now, do I replace the part, add some of the code you posted?
The front-page.php says "Static Front Page"<?php /** * Divine. * * @package Divine * @link http://restored316designs.com/themes * @author Lauren Gaige // Restored 316 LLC * @copyright Copyright (c) 2015, Restored 316 LLC, Released 3/11/2015 * @license GPL-2.0+ */ add_action( 'genesis_meta', 'divine_home_genesis_meta' ); /** * Add widget support for homepage. If no widgets active, display the default loop. * */ function divine_home_genesis_meta() { if ( is_active_sidebar( 'home-slider' ) || is_active_sidebar( 'home-top' ) || is_active_sidebar( 'home-triple-bottom' ) || is_active_sidebar( 'home-double-bottom' ) ) { remove_action( 'genesis_loop', 'genesis_do_loop' ); add_action( 'genesis_loop', 'divine_home_sections' ); add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' ); add_filter( 'body_class', 'divine_add_home_body_class' ); } }
July 17, 2017 at 8:10 am #209216Brad DaltonParticipant -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.