ThemeShaper Forums » Thematic

add thumnail photos to search results

(8 posts)
  • Started 1 year ago by cookieandkate
  • Latest reply from cookieandkate
  • This topic is resolved
  1. Hello! I've managed to add thumbnails to my archive pages with help from the forums, so I'm hoping you can help me figure out how to add the same feature to my search results. Basically, I have deactivated the new default thumbnail feature and added my own code. You can see an example of the thumbnails on my category pages (see http://cookieandkate.com/category/photography/).

    Now I just want to add the same thumbnail feature to my search results pages. As you can see, they do not include thumbnails: http://cookieandkate.com/?s=dog&searchsubmit=Search

    I'm hoping I can modify this code a little bit to add the thumbnails to my search page, too. Unfortunately I'm a dolt when it comes to php.

    Here's the code in my functions.php that pertains to the thumbnails:
    add_theme_support('post-thumbnails');

    function my_post_title($title) {
    if (is_archive()) {
    return get_the_post_thumbnail(NULL, 'thumbnail') . $title;
    } else {
    return $title;
    }
    }
    add_filter('thematic_postheader_posttitle', 'my_post_title');

    function my_post_thumbs() {
    return false;
    }
    add_filter('thematic_post_thumbs','my_post_thumbs');

    Please let me know what to add/change/how to add thumbnails to search pages. I would really, really appreciate your help!

    Posted 1 year ago #
  2. so that code works for adding thumbs to the archives? if so, then the only thing you need to change is your conditional to include search pages.

    try changing

    if (is_archive())

    to

    if (is_archive() OR is_search())

    Posted 1 year ago #
  3. yes,

    if (is_archive() || is_search())

    should work. i've used this myself when showing thumbs on search results

    Posted 1 year ago #
  4. @helga, did you get my email?

    Posted 1 year ago #
  5. Beautiful! It works! Thank you verrry much!

    Posted 1 year ago #
  6. @johnny - no i didn't. try again? helgatheviking AT gmail DOT com

    Posted 1 year ago #
  7. @helga- will do
    @cookie- good news. btw, you have a great looking site.

    Posted 1 year ago #
  8. Thanks, Jonny! Building my site has taken a lot of work. I'm glad you like it!

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.