• Hi All,

    I have been scratching my head for days now, looked around in many forums but this is beating me so I hope someone out there will shed some light…

    This is the code displaying ads for a certain category but it only works on the actual category page (e.g https://eyeads.co.uk/ad-category/eye-need/)

    <?php
    // show only ads within this specific category
    $term = get_term_by( 'slug', get_query_var('term'), get_query_var('taxonomy') );
    $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
    query_posts( array('post_type' => APP_POST_TYPE, APP_TAX_CAT => $term->slug, 'ignore_sticky_posts' => 1, 'paged' => $paged) );
    ?>

    How do I add a filter to display ad posts from a specific category?
    Thanks for your help!
    P

    [No bumping, thank you.]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Pierrick

    (@artpie)

    After more digging out, I have managed to work out away of displaying those ads broken down by category:

    <?php
    // show only ads within this specific category
    $cat_id = appthemes_get_custom_taxonomy( $post->ID, APP_TAX_CAT, ‘term_id’ );
    query_posts( array(‘post_type’ => APP_POST_TYPE, APP_TAX_CAT => ‘eye-travel’, ‘ignore_sticky_posts’ => 1, ‘paged’ => $paged) );
    ?>
    // eye-travel being of the ad categories set up
    <?php get_template_part( ‘loop’, ‘ad_listing’ ); ?>
    // The above being the templates used by the theme to display the ads

    Hope this helps someone
    P

    hei, beleza cara, deu certo, era o que eu estava precisando. valeu!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display ad posts using taxonomy’ is closed to new replies.