Results 1 to 2 of 2

Thread: Need to search Vanytage listings by a paticular category in php

  1. #1
    Thread Starter
    Expired Customer garytaylor9's Avatar
    Join Date
    Sep 2013
    Location
    United Kingdom
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need to search Vanytage listings by a paticular category in php

    I hope somebody can help. I need to create a custom home page where it only shows vantage listings by one product-listing category.

    This is the code to query the db and hopefully return listings in the 'product-listing' category. However, it returns no results when I add the tax_query part.
    There are two listings in that category. What am I doing wrong?

    global $va_options, $wpdb;

    $args = array(
    'post_type' => VA_LISTING_PTYPE,
    'posts_per_page' => $va_options->listings_per_page,
    'tax_query' => array(
    array(
    'taxonomy' => 'category',
    'field' => 'slug',
    'terms' => array( 'product-listing' )
    )
    ),
    'order' => 'asc'

    );

    $orderby = $va_options->default_listing_home_sort;

    $args['orderby'] = $orderby;
    $args['va_orderby'] = $orderby;

    $query = new WP_Query( $args );

    return $query;

  2. #2
    Thread Starter
    Expired Customer garytaylor9's Avatar
    Join Date
    Sep 2013
    Location
    United Kingdom
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [MOD NEEDED] Category Featured Carousel with Category Listings
    By ggriffin in forum ClassiPress General Discussion
    Replies: 4
    Last Post: April 6th, 2012, 04:10 PM
  2. [MOD NEEDED] Separate Search bar category (Main category dropdown, Sub-Catogory Dorpdown list)
    By anthonyportal1 in forum ClassiPress General Discussion
    Replies: 1
    Last Post: September 17th, 2011, 07:08 AM
  3. [TUTORIAL] Featured Ribbon for ad-listings & returned at top in Search and Category
    By doctorcilantro in forum ClassiPress General Discussion
    Replies: 9
    Last Post: April 15th, 2011, 09:00 AM
  4. Show parent category in index, search result and category
    By setempat in forum ClassiPress General Discussion
    Replies: 1
    Last Post: January 7th, 2011, 05:02 AM