WordPress.org

Ready to get started?Download WordPress

Forums

Create Two Separate Queries (2 posts)

  1. likemindsdesigns
    Member
    Posted 1 year ago #

    I am trying to make a custom template to query posts posted in regular WordPress Category AND custom posts created by the Plugin "All In One Event Calendar".

    I have created a template page that will call either query. Is it possible to call both at the same time? This is what I have so far:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args = array(
      'cat' => 20,
      'paged' => $paged
    );
    $cals = array(
      'post_type'=> 'ai1ec_event',
      'paged' => $paged
    );
    
    $myquery = array_merge($args,$cals);
    
    query_posts($myquery);

    I want $myquery to show all the posts in BOTH $args and $cals at the same time.

  2. likemindsdesigns
    Member
    Posted 1 year ago #

    To try an clarify, here is a link showing all my custom posts $cals

    http://fabmops.org/things-to-do/

    Here is a link showing all my regular $args WP posts for category 20 :

    http://fabmops.org/category/things-to-do-in-meridian-ms/

    I want both these types of posts to live on the same page, but I am lost how to do it. I have tried

    $myquery = $cals or $args;
    $myquery = $cals and $args;

    but neither of those work.

Topic Closed

This topic has been closed to new replies.

About this Topic