WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] No results, removing query_posts gives error (3 posts)

  1. lklawless
    Member
    Posted 1 year ago #

    Hi - I just installed the Relevanssi plugin and I'm getting "no results found" for any search.

    My search.php has this line:

    <?php $posts = query_posts($query_string . '&order=asc&orderby=title'); if (have_posts()) : ?>

    But when I remove that whole line, I get an error:

    Parse error: syntax error, unexpected T_ELSE in /home/content/l/k/l/lklawless4/html/veggietable/blog/wp-content/themes/lifestyle/search.php on line 104

    Any ideas on how to fix this?

    http://wordpress.org/extend/plugins/relevanssi/

  2. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    Do not remove the whole line, you need to keep that

    <?php if (have_posts()) : ?>

    That query_posts, however, needs to go. It's ordering the search results in alphabetical order by title, but I assume you don't miss that since you're installing Relevanssi anyway.

  3. lklawless
    Member
    Posted 1 year ago #

    Hi Mikko,

    Thanks for responding - that worked! I don't know PHP, so I was just taking out the actual "query_posts" not the whole argument (or whatever it's called).

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic