Support » Themes and Templates » dislpaying featured posts with title in header

  • NOTE: i didn’t find any satisfactory link for this thing on web.
    i am trying to include header of sites like or, but with a minimal theme in my blog.
    But i didn’t find any satisfactory code on internet. Any designer would help me anyhow??

    I am trying to include featured posts with titles in the header of my theme.

    this is the code:

    <div id="featured">
    	<ul id="carousel">
    		$featured_posts = get_posts('numberposts=3&amp;category=1');
    		foreach( $featured_posts as $post ) {
    			$custom_image = get_post_custom_values('featured_image', $post->ID);
    			$image = $custom_image[0] ? $custom_image[0] : get_bloginfo("template_directory")."/images/no-featured-image.jpg";
    			printf('<li><a href="%s" title="%s"><img src="%s" alt="%s" /></a></li>', get_permalink($post->ID), $post->post_title, $image, $post->post_title);
    	<div class="clear"></div>

    With this code the images of featured posts are showing up but not the title with link. what should i do for that??

  • The topic ‘dislpaying featured posts with title in header’ is closed to new replies.