Forums

Query a Page Taxonomy using get_posts (3 posts)

  1. BPeddle
    Member
    Posted 1 year ago #

    I am needed to briefly tweak the nav-menu.php page so I can easily add in NAV.

    There is this section:

    $recent_args = array_merge( $args, array( 'orderby' => 'post_date', 'order' => 'DESC', 'showposts' => 15, 'tag' => 'patients-and-families' ) );

    $most_recent = $get_posts->query( $recent_args );

    I added the Taxonomy Patients and Families to the Page. Now I want to query it. I have tried tag, category and few others with no luck.

    Anyone know how to query the taxonomy from get_posts?

    Thanks

  2. vtxyzzy
    Member
    Posted 1 year ago #

    I am pretty new to custom taxonomies, but I think you need the value you gave 'query_var' when you registered the taxonomy. You would use that in the arguments to get_posts.

  3. caien
    Member
    Posted 1 year ago #

    THX - this info was also helpful for me. But how can I query a set of taxonomies? Something like that didn't work:

    $get_posts->query('mytaxo'=>'tag1,tag2')

    Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic