Support » Fixing WordPress » Wp_query and variables

  • Resolved Carlo

    (@carlozuffa)


    Hi!
    Just to put it simple, i’ve a Wp_query declaration like this:
    <?php $recent = new WP_Query("category_name=xyz&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>
    and i want to replace the category name with a variable, this one;
    <?php echo ($title1) ? stripslashes($title1) : “”;?>

    How can i merge the codes and make this happen?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Wp_query and variables’ is closed to new replies.