Jump to content
Sign in to follow this  
anlinares

Recents Posts on Static Home Page (The 3,000th time you've been asked, I know.)

Recommended Posts

anlinares

So I know there are quite a few discussions about this already but when following instructions I seem to get a 'list' rather than the actual 'post' so I thought I would ask here and see what answers I get. I have a static home page and a 'News' page set as my posts page. I would like to put the most recent post excerpt on the home page below the page content. Ideally, I'd love a simple fix with a plugin. But I can code a little if needed. I found Map Categories to Page plugin (http://wordpress.org/extend/plugins/map-categories-to-pages/) and thought that might do the trick, but I'm afraid I'm not quite sure how to call the posts. I'm not committed to that plugin, though. Just whatever I can get to work. Thanks for your help! www.dalestrong.com

Share this post


Link to post
Share on other sites
Rob
Well, this one might do better as it's not outdated. http://wordpress.org/extend/plugins/posts-to-page/ Now if you don't need a featured image with the post or posts on the static homepage (if you change your mind later), you could also grab your posts via RSS. My site's front page is largely made up of RSS feeds from all the different WP installations I have across the site (there are over a dozen actually). I'm not sure that plugin will format the post that appears the same way PlatformPro would on a posts page. You'll have to try that out and see. Some CSS may be required.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Danny
Hi Ashley, I did reply to your post here: http://www.pagelines.com/forum/discussion/comment/76177#Comment_76177 But I'll write my reply here too, just in case it proves useful in the future. You could try this plugin, http://wordpress.org/extend/plugins/show-posts-shortcode/ I haven't tried it personally but I did a search through our forums and a few members seem to have no problems with it. If this doesn't help, let us know so we can assist you further.

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
anlinares
Thanks, Danny. But I think that posts just a list. Ideally, I'd like to show 1-3 of the most recent blog excerpts. Again, ideally, formatted the same as the rest of my site. Rangelone, an RSS feed sounds like it might do the trick but I'm not quite sure how to set it up. Tried to do it with some plugins but I think the probably lies more in my ignorance of php. How can I set up an RSS feed of my 'News' page below the content on the home page? Thank you!

Share this post


Link to post
Share on other sites
Kate
You can accomplish this with a hook as well... I'm assuming you also have a posts page, is that correct? And you want the posts in both places?

Share this post


Link to post
Share on other sites
anlinares
Yes, the 'News' page is my posts page. But I'd also like to post maybe the most recent 1-3 articles on the home page under the introductory paragraph. What hook could I use to accomplish this? Sounds like that's what I need! Thank you!

Share this post


Link to post
Share on other sites
kastelic
Here's a custom loop you can use. You have to have platform base activated. Then copy template.postloop.php from the platform pro folder into the platformbase folder. Then open it and paste this code in to it just after the commented line that says // Start of 'The Loop' . You will need to change the 12345 to the id number of your home page. You can find that out by viewing the source and looking at the opening body tag. [code] // Start of 'The Loop' if ( is_page('12345') ) { $args = array( "posts_per_page" => 3 ); query_posts($args); if ( have_posts() ) : while ( have_posts() ) : the_post(); //whatever you want to display goes here. echo '
'; the_excerpt(); echo "
"; endwhile; else: endif; } else [/code]

Share this post


Link to post
Share on other sites
anlinares
Thanks, Kastelic. It's getting there. Take a look. It removed my page content (there should be an introductory paragraph directly underneath the feature slider) and replaced it with the excerpt from the news article. It is not showing the title of the article and does not have the 'continue reading' link to continue the article onto a single posts page. Can I fudge with this code to fix those errors or should I try a different method? Thanks!

Share this post


Link to post
Share on other sites
Kate
Maybe try this: [code]// Start of 'The Loop' if ( is_page('12345') ) { the_content(); $args = array( "posts_per_page" => 3 ); query_posts($args); if ( have_posts() ) : while ( have_posts() ) : the_post(); //whatever you want to display goes here. echo '
'; the_excerpt(); echo "
"; endwhile; else: endif; } else [/code]

Share this post


Link to post
Share on other sites
anlinares
Thanks, Kate. Now the page content is back but no feed. Any suggestions? Thanks!

Share this post


Link to post
Share on other sites
Rob
Ashley, Without driving yourself crazy, you have two options... One I sorta suggested earlier but this got out of my hands... a plugin called RSSImport http://wordpress.org/extend/plugins/rss-import/ It's been tested... it works. It will give you title and excerpt. You can also style it to be very close to a normal post, just without the thumbnail. That can be done but it's a headache. Next, another option is TPG Get Posts which also will give you a title and excerpt, but can also give you the basic meta data (date, category, author) if you want and by default looks like your normal posts. Unlike RSS Import, you can actually set the order of the posts too. http://wordpress.org/extend/plugins/tpg-get-posts/ My good colleagues here are very diligent and highly skilled technical folks while I am a follower of Occam's Razor - the theory that the simplest solutions are usually the best. I know that for them, with their exceptional skills, effecting the changes proposed is the right and easy thing. But for others, it may not be so. The solutions I offered require minimal customization, such as the shortcode string and a few settings. You'll have to judge for yourself which you prefer. We'll still be here no matter what you choose.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
anlinares
Rangelone, easier is always better for those of us who are woefully underskilled! I appreciate any and all help and will try my best to make it work! I just don't always have the know-how! Luckily, your suggestion for the TPG Get Posts plugin worked magically!!! It is ALMOST perfect! I have it up and running. There are 3 issues: 1. Article formatting seems to be ignored. ex. There should be spaces after the phone number and date. If we can't fix this, no big deal! 2. Can I delete the author under the title? I'm okay to delete that entire line if I need to. 3. I would like to delete that bottom line with comments, tags, etc. This is my code in the page so far: [tpg_get_posts shorten_content="w600" numberposts=3 show_meta="false"] Thank you so much!!!!! Your help is so greatly appreciated!!!!

Share this post


Link to post
Share on other sites
Rob
The plugin page for TPG that I gave you earlier has all the available codes and a link to more from WP that you can use in the shortcode. It's actually quite amazing. As to how you set up the shortcode, I apologize, but my expertise is pretty limited. I'm glad however, that it worked. You're quite capable of reading and tweaking the results to the way you expect to see them. I'm confident of that!

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
anlinares
Thanks, rangelone! I'll do some more exploring over there and see if I can figure it out. You've brought me so far! Thank you so much! Love Pagelines forum!!!

Share this post


Link to post
Share on other sites
anlinares
F.Y.I. Got rid of the bottom line using this code: [tpg_get_posts shorten_content="w600" numberposts=3 show_meta="false" fields="post_title"] Can't figure out the rest of it at the moment but that was the most important part! Thanks again to everyone for the help!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×