Support » Fixing WordPress » How to display data from custom field in search results

  • Trying to display a “featured” or “special” graphic beside post title displayed in results using custom fields in posts. (only to be shown in results – didn’t like custom html in post title) Current code is

    <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>

    Anyone like to help me – i’ve only started using wordpress about a month!

Viewing 1 replies (of 1 total)
  • Did it myself

    Add new custom field “Featured”, enter url of image

    This goes into search.php within the while loop

    <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a><img src="<?php echo get_post_meta($post->ID, "Featured", true);?>" /></h3>

Viewing 1 replies (of 1 total)
  • The topic ‘How to display data from custom field in search results’ is closed to new replies.