• Resolved tvermand

    (@tvermand)


    Hi!
    This plugin is just great and will help me a lot!
    I was wondering if there is a way to select posts from the network using a specific custom taxonomy?
    I saw a message previously sent talking about filtering by categories (which in fact is a default taxonomy), but not custom taxonomy.
    Thanks a lot in advance and keep going!

    http://wordpress.org/plugins/network-latest-posts/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jose Luis SAYAGO

    (@iluminatus)

    Hello, shamefully there is no custom taxonomy support (not yet). I’m working on the next major release which will include this and several other improvements, sadly I’ve been really busy working in some projects which have forced me to put in stand by its development.

    However, if you really need this asap, then you could tweak the plugin by yourself. If you look into network-latest-posts.php file, at line 283 you’ll find this:

    // Categories or Tags
                    if( !empty($category) && !empty($tag) ) {
                        $args = array(
                            'tax_query' => array(
                                'relation' => 'OR',
                                array(
                                    'taxonomy' => 'category',
                                    'field' => 'slug',
                                    'terms' => $category
                                ),
                                array(
                                    'taxonomy' => 'post_tag',
                                    'field' => 'slug',
                                    'terms' => $tag
                                )
                            ),
                            'numberposts' => $number_posts,
                            'post_status' => $post_status,
                            'post_type' => $custom_post_type,
                            'orderby' => $orderby
                        );
                    }

    As you can see, there you can modify the default categories by those you want. For example, default taxonomy for categories is category and for tags post_tag, you could then replace those by your custom taxonomies for categories and tags.

    For post types there is already one parameter called post_type which you could use in combination with those custom taxonomies to pull posts from wherever you want.

    I hope this information helps you achieve what you need.

    Best regards,
    José SAYAGO

    Thread Starter tvermand

    (@tvermand)

    You rock, that’s a really fast, fast answer 🙂

    Thanks for the clue, I was in the process of testing that just before you answered, and it works like a charm!

    Thanks again and all the best!
    Tzvétan

    Plugin Author Jose Luis SAYAGO

    (@iluminatus)

    Hi Tzvétan, I’m glad you figured it out and got it working as you wanted.

    Kind regards,
    José SAYAGO.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Select posts using custom taxonomy’ is closed to new replies.