Category Archives: Wordpress tags

WordPress tag: get_posts. How to list Posts in one category, with offset?

Usage: <?php get_posts(‘arguments’); ?> Examples: Posts list in one category with offset: If you have your blog configured to show just one post on the front page, but also want to list links to the previous five posts in category ID 1, you can use this: <ul> <?php global $post; $myposts = get_posts(‘numberposts=5&offset=1&category=1’); foreach($myposts as […]

WordPress: Showing an image in the excerpt – using either the_post_thumbnail( ); or Get The Image plugin

Question: I prefer showing only post excerpts on the home page, but I would like a thumbnail image attached to each excerpt. How to achieve this? Answer: Two solutions: 1. Use the new the_post_thumbnail function in WordPress 2.9 Tutorial: http://www.kremalicious.com/2009/12/wordpress-post-thumbnails/ http://poplicola.com/using-the_post_thumbnail-with-wordpress-2-9/ http://justintadlock.com/archives/2009/11/16/everything-you-need-to-know-about-wordpress-2-9s-post-image-feature 2. Use Justin Tadlock’s Get The Image plugin. Tutorial: http://justintadlock.com/archives/2008/05/27/get-the-image-wordpress-plugin ============================== Important notes for […]

WordPress: Change the Full Post Content to an Excerpt

PHP code: <?php the_excerpt(); ?> ======================== To replace the post’s full content with the excerpt: search for: the_content() and change it to: the_excerpt() ======================== The multi-post displaying template files to change may include: index.php archives.php archive.php category.php search.php Note: Do NOT change it in your single.php or page.php, if you have them in your Theme, as that […]