WordPress.org

Ready to get started?Download WordPress

Forums

"cateogry__and" work around (3 posts)

  1. nadine00
    Member
    Posted 2 years ago #

    Hello!

    So according to this: http://core.trac.wordpress.org/ticket/16157 and this: http://core.trac.wordpress.org/ticket/16706 ...category__and has gone a bit AWOL. There's a suggested workaround there in the form of this:

    query_posts(array(
      'tax_query' => array(
        array( 'taxonomy' => 'category', 'terms' => 1 ),
        array( 'taxonomy' => 'category', 'terms' => 461 ),
      )
    ));

    How can I work that above item, into my theme, which has this code for a query argument:

    <?php $category_id = get_cat_ID($data['category']); ?>
                       		<?php $q = $category_id; ?> 
    
                       		<?php $catArgs = array(
                       			'category__and' => array($q, 6),
                       			'orderby'=>meta_value,
                       			'meta_value'=>student-sort,
                       			'order'=>ASC,
                       			'posts_per_page'=>5,
                       			'offset'=>0
                       		);?>

    Any suggestions would be helpful.

    Thank you!

    Nadine

  2. nadine00
    Member
    Posted 2 years ago #

    Help? Anyone?

    Basically what's happening is the user is supplying the first category through the admin, then i'm combining it with another hard coded category (it never changes).

    I really need to find a workaround that will work with 3.2, my whole template worked on a custom bit of data and category__and :( so the bug in the upgrade really, really borked me.

  3. nadine00
    Member
    Posted 2 years ago #

    It would also help if i spelt that there post title right, but i'm dyslexic. So, it happens sometimes. Sorry.

Topic Closed

This topic has been closed to new replies.

About this Topic