Community Forums › Forums › Archived Forums › Design Tips and Tricks › Excerpts on Custom Blog Page/Full Post on Home Page
- This topic has 9 replies, 4 voices, and was last updated 11 years, 11 months ago by
CarrieBYogini.
-
AuthorPosts
-
December 26, 2012 at 5:15 pm #7585
kilerb
MemberHi, I've went through a few posts on the old forum regarding this, and none of the solutions seem to be for my situation. Here's what I have.
A main page (Splash page, which is a static page with the blog template activated and a query of cat=1) so it only shows that category. Works fine. I'd like to keep it showing the entire post.
Then I have a 2nd page called "Blog" and it's basically just a 2nd category only. Use the menu to add that blog page with just the specific category. I would like this one to only show excerpts. Not the entire post. I've tried adding the codes suggested in the old forums, but I think I've made this differently than they did because they didn't work. In this scenario, how could I make this work?
Thanks!
BDecember 27, 2012 at 5:52 pm #7797Jen Baumann
ParticipantCan you provide a link to your site and in particular, which pages you want which scenario to apply to? Thanks.
December 27, 2012 at 5:53 pm #7798kilerb
Memberhttp://lorasomoza.com/ ... Want full posts on the main page since it's a podcast and want the play buttons to show.
Just want excerpts under the blog tab... http://lorasomoza.com/?cat=3
Thanks!
December 27, 2012 at 6:28 pm #7804Jen Baumann
ParticipantOk, so there's a couple of things to address here.
When you set the homepage to use the blog page template, that normally causes problems with pagination once you have enough posts to see that. So, I recommend against that. Instead, you can have a home.php that should solve all problems.
Create a home.php and add this content:
<?php /** Removes everything form post content **/ remove_all_actions( 'genesis_post_content' ); /**Add full content**/ add_action( 'genesis_post_content', 'the_content' );
/**use only category 1**/ function child_before_loop () { global $query_string; query_posts ($query_string . '&cat=1'); } add_action('genesis_before_loop', 'child_before_loop'); genesis();
For the Podcast category, you'll probably want a function like this as well in functions.php
add_action( 'genesis_before', 'child_conditional_actions' ); function child_conditional_actions() { if( is_category( 1 ) ) { remove_all_actions( 'genesis_post_content' ); add_action( 'genesis_post_content', 'the_content' ); } }
Then, make sure you set your Settings > Reading to display your latest posts and set the Theme Options to display either Excerpts or a Content Limit.
Let me know how that works.
December 30, 2012 at 8:32 pm #8504kilerb
MemberHi there! Just got back and am trying this now.
I added the codes you suggested to home.php and functions.php and it still seems to show either excerpts or full posts on both pages, depending what's selected in the Genesis area.
Also, after trying that, I figured I had to change the "reading" area in settings to "show latest posts" ... After doing that, I got this error below... (I replaced the site with mydomain so it's not on here a bunch of times.)
Parse error: syntax error, unexpected '<' in /nfs/c05/h04/mnt/160582/domains/mydomain.com/html/wp-content/themes/streamline/home.php on line 43
Probably doing something dumb, but not sure what. I left the code where you told me to put it. Did I do something wrong?
Thanks!
B
January 2, 2013 at 12:05 pm #8976kilerb
MemberNot one to bump things, but I figured this might have gotten lost in the mix during the holidays! 🙂 Happy New Year... Would love to get this going today if you're around. I might have done something wrong, but I'm pretty sure I copy and pasted these snippets correctly.
Thanks!
January 3, 2013 at 9:32 am #9181Jen Baumann
ParticipantIf you already had <?php at the top of home.php, then adding another will cause that. This should be a new home.php, not one that came with the theme.
January 3, 2013 at 11:50 am #9202kilerb
MemberThanks 🙂
January 4, 2013 at 7:42 pm #9649Cathy @ WPBarista
MemberI'm using this code, Jen, and my read more filters aren't being executed... I've added the filter to a custom function like this in the home.php file:
/**add some functions to run before loop**/ add_action( 'genesis_before','dswp_run_before'); function dswp_run_before() { /** Modify the Genesis content limit read more link */ add_filter( 'get_the_content_more_link', 'bargainstobounty_read_more_link' ); function bargainstobounty_read_more_link() { return '... <a class="more-link" href="' . get_permalink() . '">Read More »</a>'; } /** Modify the WordPress read more link */ add_filter( 'the_content_more_link', 'custom_read_more_link' ); function custom_read_more_link() { return '<a class="more-link" href="' . get_permalink() . '">Read More »</a>'; } }
They're still not showing though - no read-more links at all!
Visit WP Barista to download 52 Quick Edits You Can do Today to Get More Clicks / Views / Sales. I also do paid support (starting at $75) and fully custom Genesis Child Themes.March 26, 2013 at 6:17 pm #31432CarrieBYogini
MemberI don't ? think this "topic" covers my issue. However maybe someone may have the answer!!
My "sticky" post, I want the whole POST to show but only on the sticky not on the other blog posts. Am I to input a code just on that post itself and if so, what would the code be?
The post that says "Namaste Creative Yoga Spirits" is the one I want to show the whole post; not to be changed unless I change it!!
Anyone???
Also I'm trying to make blocks on my "shoppe" page that looks like http://hibiscusmooncrystalacademy.com/shop/ !!
Can you send me to a post that describes instructions for this or provide here? I've been working at this soooo long and I just need to figure out these 2 things and I'll be the happiest yogini!!
Thanks sooo much!
Carrie B!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.