• Resolved Tribun

    (@3task)


    Hi!

    I get no search results.

    Your search for “gladiator” did not match

    Make sure all words are spelled correctly
    Try different keywords
    Try more general keywords

    Can you help me please?

    My search.php is this:

    https://pastebin.com/WALyhENq

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

    (@msaari)

    Find this line in the search.php:

    $query = new WP_Query($args) ;

    Comment it out (add // in the beginning of the line). Now the search should work.

    Thread Starter Tribun

    (@3task)

    Thank you for your quick reply!

    Unfortunately it dont work.

    This is my line:

                                                    );
    //                                $query = new WP_Query($args) ;
                    ?>

    Then I get this error:
    Fatal error: Call to a member function have_posts() on a non-object in /www/htdocs/******/dev/test/wp-content/themes/******/search.php on line 179

    Line 179 is:
    <?php if ( $query->have_posts() ) : ?>

    Thank you!

    • This reply was modified 8 years, 4 months ago by Tribun.
    Plugin Author Mikko Saari

    (@msaari)

    Ah, missed that. Instead of $query->have_posts(), you need to have just have_posts(). Also, instead of $query->the_post();, you need to have the_post(); and instead of $query->max_num_pages, use $wp_query->max_num_pages.

    Thread Starter Tribun

    (@3task)

    Thank you it works now. Great Plugin!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Dont work’ is closed to new replies.