Related Posts by taxonomy using Advance Custom Fields Plugin
You can use the relations field from ACF. Then you could select your own related posts for each blog item.
You can use the relations field from ACF. Then you could select your own related posts for each blog item.
The way to go would be to create an archive template for your taxonomy. Then you can catch the term requested with a function like get_queried_object(). So now you can do a custom WP_Query querying for both your term and your meta ‘featured’ Hope that makes sense http://codex.wordpress.org/Class_Reference/WP_Query http://codex.wordpress.org/Template_Hierarchy#Custom_Taxonomies_display
You can get the Packages of the current Proposal using wp_get_object_terms() and then pass some/all of those into a WP_Query. $terms = wp_get_object_terms( $post_id, ‘packages’, array( ‘fields’ => ‘ids’ ) ); $args = array( ‘post_type’ => ‘proposals’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘packages’, ‘terms’ => $terms ) ), ); $related = new WP_Query( $args … Read more
While I can’t guarentee that this is what you are looking for (as you have not posted what your expected output should be), hopefully this will help. Even if it’s not exactly what you are looking for, you have the whole object for each term available to you so that you can manipulate the output … Read more
Did you try adding a count callback? // Register Custom Taxonomy function custom_taxonomy() { $labels = array( ‘name’ => _x( ‘Taxonomies’, ‘Taxonomy General Name’, ‘text_domain’ ), ‘singular_name’ => _x( ‘Taxonomy’, ‘Taxonomy Singular Name’, ‘text_domain’ ), ‘menu_name’ => __( ‘Taxonomy’, ‘text_domain’ ), ‘all_items’ => __( ‘All Items’, ‘text_domain’ ), ‘parent_item’ => __( ‘Parent Item’, ‘text_domain’ ), … Read more
You can do like following $thiscat = $wp_query->get_queried_object();//put this code $args = array( ‘post_type’ => ‘sports’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘sports_category’, ‘field’ => ‘slug’, ‘terms’ => $thiscat->slug // Pass this to slug ), ), ); $myquery = new WP_Query($args); then you can able to fetch post titles tagged under football and basketball separately … Read more
Your code is all upside down and scrambled. What you would want to do is to check for a specific term and then feed that into get_the_term_list(), not the other way around. Also, evaluate your switch to true. I would probably first get an array of terms attached to the post and then check if … Read more
$seach_values can be changed whenever the site redirect, be sure that $search_values still keeps the input values from your search form. To be sure I suggest use GET or POST to pass the values from form. So, your comparing statement should be $_GET[‘grades’] == $term->slug Here I suppose your search form use method=”GET”
Custom post type term names with ampersand in the term name
What to do with shared terms splitting in WordPress 4.2?