Push multiple taxonomy terms into wp_get_post_terms

by SixfootJames   Last Updated February 13, 2018 13:08 PM

My Taxonomies are called Keywords and Classifications. I am trying to pull the post title out of random posts out of these taxonomies.

From this page https://codex.wordpress.org/Function_Reference/wp_get_post_terms

I understand that I can push an array into

//Do something if a specific array value exists within a post
$term_list = wp_get_post_terms($post->ID, 'classifications', array("fields" => "all"));
    foreach($term_list as $term_single) {
        echo $term_single->slug; //do something here
        echo (get_the_title());
}

According the documentation, I can push an array into the $taxonomy

<?php $terms = wp_get_post_terms( $post_id, $taxonomy, $args ); ?>

The end result needs to pull 5 random posts from two taxonomies.

Tags : taxonomy


Related Questions


How to add images to taxonomies?

Updated March 05, 2017 21:08 PM

Taxonomy Terms That Don't Exist Display Results

Updated May 07, 2017 06:08 AM


Sorting taxonomy columns by meta value numeric

Updated July 06, 2017 14:08 PM


Cache file /home/queryxchang/public_html/apps/frontend/config/../cache/-q-9-293972-push-multiple-taxonomy-terms-into-wp-get-post-terms- could not be written