• aklemmer

    (@aklemmer)


    Hi there,

    I am trying to use a custom query within the Category Archive page. The goal is to display several “featured” posts in the category above the full archive.

    I’ve tried to implement this with the custom query option in the AE – Post Blocks element, using the code pasted below. This filter displays “featured” posts from all categories, not just the current one. Is there any way to make a filter that will show only Featured posts from the archive category?

    /* begin code */

    function my_super_filer_function($query_args){

    $qobj = get_queried_object();
    $query_args[‘taxonomy’] = $qobj->taxonomy;
    $query_args[‘meta_key’] = ‘featured_post’;
    $query_args[‘meta_value’] = 1;
    return $query_args;

    }

    add_filter(‘my_super_filter’, ‘my_super_filer_function’);

    /* end code */

    Thanks in advance,
    Austin

The topic ‘Category Archive “Featured Posts”’ is closed to new replies.