Jan 11 ,11
create « »

Last post’s excerpt on category.php (WordPress, php)

	foreach((get_the_category()) as $category) 
		$postcat= $category->cat_ID; 
		$catname =$category->cat_name;

<a href="<?php the_permalink() ?>">
	<?php the_excerpt('more_link_text', strip_teaser, 'more_file'); ?>


This code snippet for wordpress works within category.php. It simply shows the last post’s excerpt in the current category
e.g. a picture or a meaningful text.

Leave a Reply

You must be logged in to post a comment.