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: 2. Use Justin Tadlock’s Get The Image plugin. Tutorial: ============================== 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 […]