Forum Replies Created
-
AuthorPosts
-
theUserMember
Correction for my no 1 code (functions.php):
//* Register a new sidebar genesis_register_sidebar( array( 'id' => 'home-featured-post', 'name' => __( 'Home Featured Post', 'goblogoon' ), 'description' => __( 'Featured Post widget before post list!', 'goblogoon' ), ) );
The code i embedded doesn’t display any posts on the home page. You can easily create a new page and select the blog page template to display a list of posts.
It mean we need to set Reading Setting on Setting Panel WordPress Admin to static page, blog as post page? How about home page section?
theUserMemberHello Mr. Dalton. Thank you for your kindness.
I’m sorry. After my above post, I tried googling and found a few things on Mr Brian site and code snippet/tutorial on my StudioPress account. And I tried a few things.
Child theme : Goblogoon Theme
1. I’ve added a widget before content. Here’s my code:
<?php add_action( 'genesis_meta', 'goblogoon_home_genesis_meta' ); /** * Add widget support for homepage. * */ function goblogoon_home_genesis_meta() { if ( is_active_sidebar( 'home-featured-post' ) ) { add_action( 'genesis_before_content', 'goblogoon_home_loop_helper' ); } } /** * Display widget content for home featured sections. * */ function goblogoon_home_loop_helper() { if ( is_active_sidebar( 'home-featured-post' ) ) { echo '<div id="home-featured-post"><div class="wrap clearfix">'; dynamic_sidebar( 'home-featured-post' ); echo '</div><!-- end .wrap --></div><!-- end #home-featured-post -->'; } } genesis();
And then, create home.php. Here my code that take it from my balance child theme:
<?php add_action( 'genesis_meta', 'goblogoon_home_genesis_meta' ); /** * Add widget support for homepage. * */ function goblogoon_home_genesis_meta() { if ( is_active_sidebar( 'home-featured-post' ) ) { add_action( 'genesis_before_content', 'goblogoon_home_loop_helper' ); } } /** * Display widget content for home featured sections. * */ function goblogoon_home_loop_helper() { if ( is_active_sidebar( 'home-featured-post' ) ) { echo '<div id="home-featured-post"><div class="wrap clearfix">'; dynamic_sidebar( 'home-featured-post' ); echo '</div><!-- end .wrap --></div><!-- end #home-featured-post -->'; } } genesis();
Is it better to use ‘genesis_before_loop’ instead of ‘genesis_before_content’? Advice me, please?
I see there are some similarities with yours. But the fact is, when I try it (my code) on the local host, it became fullwidth and genesis featured post reduce the number of front-page post. It mean, If I set 10 posts to show at the front page, 5 post for genesis featured widget, then appear 5 post only under widget.
Q: What’s the different of ‘genesis_before_loop’ and ‘genesis_before_content’? Do I have complete the home.php code?
Advice me, please?
I became increasingly curious.
theUserMemberThis reply has been marked as private. -
AuthorPosts