• I need Thumbnails of Images in the search result. Why it don’t go? My Code in Wp search.php :

    <?php if ($post->post_type == 'attachment'): ?> <section class="media image"> <a class="fancyimg" rel="fancygallery" href="<?php echo wp_get_attachment_url($post->ID); ?>"><?php echo wp_get_attachment_image($post->ID, 'thumbnail', 0); ?></a> <a class="fancyimg fancycaption" rel="fancygallery" href="<?php echo wp_get_attachment_url($post->ID); ?>"><?php the_title(); ?></a> </section> <?php else : ?>

    But i get no preview 🙁 Must i edit the functions.php or relevanssi plugin code for pictures in the search result? Please give me introductions how can i fix it….Thanks

    https://wordpress.org/plugins/relevanssi/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mikko Saari

    (@msaari)

    What does the code print out? What kind of HTML source code you see on the result pages?

    Thread Starter mr0808end

    (@mr0808end)

    only the result for posts and pages

    Plugin Author Mikko Saari

    (@msaari)

    So, is the problem

    a) you don’t actually see any attachments in search results?

    b) you see attachments, but the images don’t show up?

    In case of a), make sure Relevanssi is actually set to index attachments in the Relevanssi settings page.

    Thread Starter mr0808end

    (@mr0808end)

    The problem is only with pictures by nextgen gallery.The posts are listet but not the attachments

    Thread Starter mr0808end

    (@mr0808end)

    how can i include preview pictures for nggpictures (nextgen gallery)???

    Plugin Author Mikko Saari

    (@msaari)

    Ok, now we’re getting somewhere. Relevanssi cannot search NextGen Gallery images at all: they are not posts, but instead stored in an external database (the ngg_pictures post type appears in Relevanssi settings, but at least on one site of mine with NGG, there are no posts of that post type in the database). Thus, Relevanssi has no access to the pictures.

    If you want to find NGG images in search, you need to find another search solution (I don’t know if there are any).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Why can't i have preview images in searchresult in new version?’ is closed to new replies.