• Resolved ZaddKeefer

    (@zaddkeefer)


    My search query doesn’t seem to work, the query in my url is all correct but the content just refreshes without finding the posts with the search term..

    I got a custom search query and a function to only search for words in the title.

    Heres my index.php:
    https://pastebin.com/8CPWy3Ye

    Heres my search filter function function.php:
    https://pastebin.com/uyUPT9jR

    If I remove my custom query it all seems to work, I don’t know if it’s because my search form can’t fetch the parameters in my custom post query?

    all help appreciated ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ZaddKeefer

    (@zaddkeefer)

    Found out the search query works without my custom query:
    Normal while:

    <?php if (have_posts()) : ?>
    
    <?php while (have_posts()) : the_post(); ?>

    But I want it to work my custom while:

    <?php if ($movies->have_posts()) : ?>
    
    <?php while ($movies->have_posts()) : $movies->the_post(); ?>

    I tested if the function had anything to do with the custom query.. It hadnt, so it might be the form that need to be found in my custom query?

    Thread Starter ZaddKeefer

    (@zaddkeefer)

    Can ANYBODY help with this

    Thread Starter ZaddKeefer

    (@zaddkeefer)

    Nevermind.. solved it on my own with global function:

    global $orderby;
    $original_query = $orderby;
    $orderby = null;
    $orderby = new WP_Query( $args );

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Search Query Not Working, just refreshes content?’ is closed to new replies.