I am wanting to display the title, featured image, excerpt, and read more link for posts from my custom post type in a horizontal manner. Some other things I want to do here is limit the post count to 3.
I’ve looked for plug ins to do this, but all seem to fall a little short. For example, since i want to display these horizontally, I would need a plug in to be able to offset posts. I haven’t found one that does all those things. The only one is for the Genesis framework and Im not using that. 🙁 Can someone make a suggestion?
I’ve also tried using a php call <?php include("recent-portfolio-items.php"); ?>
instead of a widget area, but I’m not a PHP guru so am running into issues with that as well.
For an example of what I’m trying to do, visit this link and scroll down to the Portfolio section http://www.streetfiredesigns.com/testsite/ Right now I am just using text widgets to give the look I’m going for.
You’ll want to first set up a new query and enter the loop. Here’s how you would set up a query to retrieve only posts from your custom post type:
Then, you need to enter the loop in order to retrieve the data you’re looking for:
have_posts()): $query->while(have_posts()): $query->the_post(); ?>
Then, you can just use standard WordPress loop functions like
the_title();
andthe_excerpt();
to display the content for the current item in the loop. Ideally, you would want a template kind of like this:Your mileage will vary. You can start with the above, and then theme the result with CSS to achieve the desired effect.
Here’s all the code:
Hopefully this helps!
Hmm… this shouldn’t be too hard. I did a quick search and came up with this one:
http://wordpress.org/plugins/latest-custom-post-type-updates/. There are probably many like it.
You should be able style the output to display horizontally using CSS, no need to “offset posts”.