WordPress.org

Support

Support » How-To and Troubleshooting » query_posts() Variables as Arguments

query_posts() Variables as Arguments

  • The following works perfectly:

    $current_issue = query_posts('tag=April+2012&category_name=Cover');

    What I cannot get to work is:


    $tag_var = 'April+2012';

    $current_issue = query_posts("tag=$tag_var&category_name=Cover");

    I’ve tried multiple variations such as:

    $tag_var = 'April+2012';

    $current_issue = query_posts('tag='.$tag_var.'&category_name=Cover');

    But nothing works. I get either an empty array or the fisrst “n” posts (where “n” = the default posts-per-page setting)

    Kudos and accolades for any help to make this work.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘query_posts() Variables as Arguments’ is closed to new replies.