Community Forums › Forums › Archived Forums › Design Tips and Tricks › Full Post then Excerpts
- This topic has 14 replies, 5 voices, and was last updated 10 years ago by Sridhar Katakam.
-
AuthorPosts
-
January 16, 2014 at 3:39 am #85470[email protected]Member
Hi!
I am using the Jane theme.
I would like to show on full post and then show excerpts after that.
How would I do that?http://129.121.133.196/~southe10/
Thanks!
http://129.121.133.196/~southe10/
KendraJanuary 16, 2014 at 6:16 am #85480Sridhar KatakamParticipantJanuary 16, 2014 at 9:23 am #85500Genesis DeveloperMemberAlso you can achieve this using few codes. Here is the code:
add_action('template_redirect', 'sp_custom_post_content'); function sp_custom_post_content(){ if( is_home() || is_front_page() || is_page_template('page_blog.php') ){ // this will call for home, front & blog template page remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); remove_action( 'genesis_post_content', 'genesis_do_post_content' ); add_action( 'genesis_entry_content', 'genesis_do_custom_post_content' ); add_action( 'genesis_post_content', 'genesis_do_custom_post_content' ); } } function genesis_do_custom_post_content(){ global $wp_query; if( $wp_query->current_post == 0 ){ // Only first post will display full content the_content(); }else{ the_excerpt(); } }
January 16, 2014 at 5:27 pm #85574[email protected]MemberThanks so much!!
I should just search your blog every time!!Kendra
January 16, 2014 at 11:32 pm #85589maliha3492MemberThanks so much!!
I should just search your blog every time!!
maliha
January 17, 2014 at 5:04 pm #85698[email protected]MemberHi! I actually have one more question...
Now that I have one full post showing and then excepts would it be possible to insert a graphic after the first post but before the excerpts that says "recently on southern revivals."Here is my site:
http://129.121.133.196/~southe10/
Here is an example:
http://www.inspiredbycharm.comJanuary 19, 2014 at 11:33 pm #86037Sridhar KatakamParticipantTry adding this in functions.php:
add_action( 'genesis_after_entry', 'graphic_after_first_post' ); function graphic_after_first_post() { if ( !is_home() || is_paged() ) return; global $wp_query; if( ($wp_query->current_post == 0) ) { echo '<div class="after-first-post">HTML to show your desired graphic here</div>'; } }
For Pre-HTML5 themes, genesis_after_entry should be replaced with genesis_after_post
January 20, 2014 at 5:34 pm #86194[email protected]MemberTHANK YOU!!!! worked perfect!
January 20, 2014 at 6:06 pm #86200[email protected]MemberOne more question for you ...
Now that I have one full post add then excerpts I still want to use the "show featured imaged" function so that the excerpts have a featured image thumbnail. .. .BUT then the image on the first post show ups twice (the featured image and also the image that was inserted to the post)THANKS!
KendraJanuary 20, 2014 at 7:53 pm #86208Sridhar KatakamParticipantAdd this CSS:
.home .entry:nth-child(1) .entry-image { display: none; }
January 21, 2014 at 3:07 am #86244[email protected]MemberThanks again! Worked perfect as well!
KendraApril 2, 2014 at 10:59 am #98099Kristie HillMemberThanks for asking this question Kendra, I was wondering the same thing. @Shridha, is it possible to do this on a sticky post of a category? I want the first post in the category to show full content.
Kristie Hill
April 4, 2014 at 6:11 am #98425Sridhar KatakamParticipantApril 4, 2014 at 2:03 pm #98515Kristie HillMemberHi. thanks for the tutorial. I inserted the code, but it isn't working on my category.
http://dreamyambitions.com/how-to-start-a-blog/
the firs post is still showing as an excerpt
Kristie Hill
April 5, 2014 at 5:07 pm #98665 -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.