Community Forums › Forums › Archived Forums › General Discussion › Adding Content Before the Posts on a Blog Page
Tagged: ambiance pro, filter, homepage
- This topic has 3 replies, 3 voices, and was last updated 10 years, 3 months ago by Webmaster.
-
AuthorPosts
-
August 30, 2014 at 10:56 pm #121984WebmasterMember
Using the Genesis Snippets code (http://my.studiopress.com/snippets/blog-page-content/) doesn't work for Ambiance Pro. Anyone done this in Ambiance Pro before? Clues? Alternative approach? Thanks.
“If it works, mark the post as [Resolved] so others will feel comfortable trying the solution on their website.“
August 30, 2014 at 11:25 pm #121990Brad DaltonParticipantAugust 31, 2014 at 12:29 am #122006Sridhar KatakamParticipantSeptember 2, 2014 at 10:24 am #122426WebmasterMemberHey guys, thanks for the help, but there is nothing wrong with my site - or the snippet for that matter. The problem is that Ambiance Pro comes with a custom page_blog page that displays posts with hover images (just like the ones on the homepage for Ambiance Pro) so the snippet(s) that work for a normal Genesis theme don't work. Instead you get a box with the page title in it.
Here's the code that comes stock in the Ambiance Pro page_blog page:
//* Reposition the entry meta in the entry header
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_entry_header', 'genesis_do_post_title', 13 );//* Add Ambiance grid body class
add_filter( 'body_class', 'ambiance_grid_body_class' );
function ambiance_grid_body_class( $classes ) {$classes[] = 'ambiance-grid';
return $classes;}
//* Customize the entry meta in the entry header
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
add_action( 'genesis_entry_header', 'ambiance_post_info', 12 );
function ambiance_post_info() {echo '<p class="entry-meta">' . do_shortcode( '[post_date]' ) . '</p>';
}
//* Remove entry content
remove_action( 'genesis_entry_content', 'genesis_do_post_content' );//* Remove entry meta in entry footer
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );//* Remove page navigation
remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 );//* Run the Genesis loop
genesis();That results in a page that looks like this:
So when you add the snippet you get this:
As you can see, the text in the blog page still does not show, although we now have the page title inside a grey box, along with the date the blog page was created. Now if you rip out all the code that comes stock with page_blog in this theme and then add the snippet, well then everything works as expected. Of course, you lose the formatted post squares that match the home page.
“If it works, mark the post as [Resolved] so others will feel comfortable trying the solution on their website.“
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.