• Resolved Chrissy

    (@paperkawaii)


    Hi!
    Have been using your plugin soo long it’s the best for the purpose. So thanks for that ??

    I have been trying to add a grid as the search results, using the “Takeover” feature that’s listed in the changelog.

    I’ve added a new post grid and then put the following code into the search.php file.

    <?php echo do_shortcode( '[wpupg-grid id="search-grid" takeover="search"]' ); ?>

    However it doesn’t show the queried posts that it should, it just shows them all in date order.

    I have left the normal query there so you can see the actual results underneath. It makes no difference when I remove that section.

    The page in question is here: https://origami.guide/?s=crown
    It is using a basic twenty fifteen or twenty twelve search results page.

    Hope you could help me figure out how to get this working?

    I need to renew my licence for the premium version, however this feature should be working in the base plugin anyway?

    Best wishes,
    Chrissy

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Brecht

    (@brechtvds)

    Just tested with the latest version of Twenty Fifteen and it does actually work as expected for me.

    It could be some kind of compatibility problem with another plugin. Could you try using the Health Check plugin to test? We have a video in our documentation showing you exactly how to do that: https://help.bootstrapped.ventures/article/108-debugging-plugin-problems

    Specifically the compatibility mode shown in the video where it basically tests with no other plugins active.

    Thread Starter Chrissy

    (@paperkawaii)

    Hello, thanks for the reply ??

    I have installed and played around with the troubleshooting plugin, using the base twenty fifteen theme and just your plugin, the search result is the same, the grid will all posts.

    I wonder if I’m doing something wrong here.

    I’ve also tried on a seperate website and that did not work either. Do I have the code right?

    <?php echo do_shortcode( '[wpupg-grid id="search-grid" takeover="search"]' ); ?>

    Put under:

    <div class="search-results"> in search.php

    The grid was new and had no settings apart from the default options.

    I’ve tried query instead of search also with no result. Wonder what I’m doing wrong.

    Thread Starter Chrissy

    (@paperkawaii)

    I couldn’t get the takeover code to work. Tried so many things…
    However I have ended up putting this instead into the search.php:

    $post_ids = wp_list_pluck( $wp_query->posts, 'ID' );
    $post_ids_string = implode( ',', $post_ids );
    echo do_shortcode( '[wpupg-grid id="search" post_id="' . $post_ids_string . '"]' ); 

    Works well, also have a similar thing on the archive template.

    Chrissy

    Plugin Author Brecht

    (@brechtvds)

    Very strange. I basically just copied and pasted the exact code you used and it worked for me (after making sure a grid with slug “search-grid” existed) so I’m not sure what could be going wrong.

    The post ID solution should work just as well though, so happy to hear that does work!

    If you want me to debug the original issue, send an email to [email protected] and I’m happy to look into it further there.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Takeover search feature can’t get to work’ is closed to new replies.