Support » Plugin: Relevanssi - A Better Search » No results, removing query_posts gives error

  • Resolved lklawless


    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?

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


    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.

    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘No results, removing query_posts gives error’ is closed to new replies.