I need a plugin for WordPress, that can display the titles/first words of the latest blog entries. The blog is on a subdomain and I want these latest entries to be displayed on the main home page. I searched for such a plugin but couldn't find one. Anyone know of some ready-made one?
If you want it to display outside the blog, a WordPress plug-in isn't going to do much for you I don't think. Probably easier just to query the WP database directly.
Shawn, you are right. I just don't want to write it myself, but I'll have to if no one points to an already-written solution.
I don't know of anything, but here's a query that will get all the info you need for the 5 most recent posts... SELECT post_title,post_name FROM wp_posts ORDER BY post_date DESC LIMIT 5; Code (sql):
nohaber, you could use the rss feed from the blog and display it on another site via a php script. Your feed can be found here: http://blog.seoguide.org/?feed=rss the php script to show the rss feed can be found here: http://forums.digitalpoint.com/showthread.php?t=7354
Thanks for the tips. Actually, it turned out to be easy. I just put a php file in the blog subdomain and include it from the main page. If someone is interested here's the code I use: <?php require_once( dirname(__FILE__) . '/wp-config.php'); $title_was_printed = false; $posts = get_posts('numberposts=3'); foreach ($posts as $post) : if ($title_was_printed == false) {$title_was_printed = true; print "<h1>Latest SEO Blog Entries</h1>";} ?> <p><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a> - <small><?php the_time('l, F jS, Y') ?> - Posted in <?php the_category(', ') ?></small></p> <?php endforeach; if ($title_was_printed == true) { ?> <p align=right style="margin:0px; padding: 0px;"><a href="http://blog.seoguide.org"><b>»» Read The SEO Blog ««</b></a></p> <?php } ?> Code (markup): It works well on my home page http://www.seoguide.org
Haber, I tried this, but get the following error (I'm using WordPress 2.0 by the way): Fatal error: Call to a member function get_row() on a non-object in /blog/wp-includes/functions.php on line 281 I'm stuck. Any clues? Thanks, Dave
Well, I could look at that can of worms next, but I've finally gotten the lid off this can... I guess because I'm not sure how much I can customize the RSS feed relative to what I want to appear on my home page. I have a standard RSS feed, but I want titles, dates & possibly a short summary only on the home page. Come to think of it I probably should consider this... Anyway I did figure out the problem I posted about. I had to include wp-config.php at a higher level than on the specific page I was working on. I added it to our standardincludes.php file and all is well.