688 posts
  • Has been part of the Envato Community for over 7 years
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+3 more
_rg_ says

Anybody knows how to do this:?

I have for example this query:
$home_query = array(
    'posts_per_page' => $home_1_posts,
    'cat' => $home_1_cats_in,
    'category__not_in' => $home_1_cats_out,
    'tag__in' => $home_1_tags_in,
    'tag__not_in' => $home_1_tags_out
    );

query_posts($home_query_area_1);

I know how to concatenate the $query_string using, let´s say:

global $query_string;
query_posts( $query_string."&.orderby=");

That in order to use the pre-existing query args and only mixed with new ones…

But, how can i use the $query_string or similar, if using $args (as my first code) to the query_post ? I need to make the loop keeping for example the post_count value….

688 posts
  • Has been part of the Envato Community for over 7 years
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+3 more
_rg_ says

To be more clear, let´s say you have this situation, where each loop is independent and reset count once finished:

LOOP #1 : post count 1, 2, 3

LOOP #2 : post count 1, 2, 3

LOOP #3 : post count 1, 2, 3

Into each loop you can select diferent cats, ok, but, what if you use same cats and then the post count needs to be (that´s what i´m trying) this way:

LOOP #1 : post count 1, 2, 3

LOOP #2 : post count 4, 5, 6

LOOP #3 : post count 7, 8, 9…

any idea will be great!

688 posts
  • Has been part of the Envato Community for over 7 years
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+3 more
_rg_ says

nevermind:

global $wp_query;
query_posts(
    array_merge(
        array('cat' => 1),
        $wp_query->query
    )
);

:)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by