Archived

This topic is now archived and is closed to further replies.

  • 0

Resolved Featured Image On Search Results Template


Question

Posted · Report post

Is there a way to display the featured image as a thumb on the search page template in framework?

Share this post


Link to post
Share on other sites

10 answers to this question

Posted · Report post

Found this bit of code from a wp forum. Says to place in the search.php

[color=#000000][font=Consolas, Monaco, 'Courier New', Courier, monospace][size=3][background=rgb(243, 243, 247)]<div class="results">[/background][/size][/font][/color]

<div class="thumbs"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php if ( function_exists( 'get_the_image' ) ) { get_the_image('width=150&height=150&image_scan=true&default_image=http://yoursite.com/default.jpg' ); } ?></a></div>

<div class="blogposts">

<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<?php the_time('F jS, Y') ?> by <?php the_author_posts_link(); ?><br />

<p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>

</div>

</div>

Where should this go?

Share this post


Link to post
Share on other sites

Posted · Report post

Where is search.php?

Share this post


Link to post
Share on other sites

Posted · Report post

search.php is the search form file WP provides in themes by default (located in the theme folder directories), but PageLines does not use this file since the structure is a bit different, adding that code to any of the PageLines files may not work. In this case, a different code solution may be needed.

Share this post


Link to post
Share on other sites

Posted · Report post

James, or anyone know how to do the hook/filter method?

Share this post


Link to post
Share on other sites

Posted · Report post

I'll check with one of the developers to see if there's an easier way to do this for you.

I can point you in the right direction to find the hooks api and the reference files but you'll need to know the correct PHP to enter to pull through the content. The code you've pasted above doesn't look like it would work inside the framework, as we'd have our own structure which would differ from the standard wordpress setup.

A list of the pagelines hooks can be found here http://api.pagelines.com/hooks.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi there, i've checked with the dev team. Apparently you can now add the thumbs automatically to the search page by checking a radio box in Pagelines>site options>blogs and posts. Scroll down to the 'thumbnail placement section', you'll see a radio box for 'search page'.

Share this post


Link to post
Share on other sites

Posted · Report post

Great feature. Works wonderfully. Thank you! Resolved.

Share this post


Link to post
Share on other sites

Posted · Report post

The topic was marked as resolved.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi there, you could use a hook/filter to do this. However this plugin might be easier, try it and if it doesn't work as expected let us know and we'll help you with the hook.

http://wordpress.org/extend/plugins/get-the-image/

Share this post


Link to post
Share on other sites

Posted · Report post

I'm guessing I add <?php get_the_image(); ?> to the search.php file? That's what I'm going to try.

Share this post


Link to post
Share on other sites