get_the_term_list() display in ul li and remove tag
<?php $terms = get_the_terms(); echo ‘<ul class=”styles”>’; foreach($terms as $term){ echo “<li>”.$term->name.”</li>”; } echo “</ul>”; ?>
<?php $terms = get_the_terms(); echo ‘<ul class=”styles”>’; foreach($terms as $term){ echo “<li>”.$term->name.”</li>”; } echo “</ul>”; ?>
I hope I understood everything correct: display a specific custom field from a custom post-type post assigned to a specific term in a custom taxonomy for todays and yesterdays latest entry I can’t solve this task improving your SQL-statement, but you can try the following function using standard WordPress stuff: function show_latest48h_post_cf_in_term( $cpt, $tax, $term_slug, … Read more
May be not the best solution, but I managed to get what I need and it works. I could have added to output html ul and li tags too to create the list as I asked in the beginning, but this is OK for me and no more styling needed for this design. $queried_taxonomy_name = … Read more
It looks like the problem is here: ‘terms’ => $term where in your case it’s like: ‘terms’ => “array( ‘peoria’, ‘adams’ )” but it should be like ‘terms’ => array( ‘peoria’, ‘adams’ ) By looking at your code snippet, you could try ‘terms’ => explode( ‘,’, $term ); since explode will return the array you … Read more
displaying links if term is used
I do not know plugin you’re looking for and actually this could turn your question into off-topic. But you can try this one. Instead you could run some SQL queries.
Use brackets in the name attribute: ‘<input type=”checkbox” name=”t[‘ . $term->name . ‘]” value=”1″> Then get the keys with: array_keys( $_GET[‘t’] ); See also: Settings API with arrays example
use get_the_terms instead and exclude any terms where parent value is 0, which means it is a top-level term. $terms = get_the_terms( $post->ID, ‘portfolio-type’ ); if ( !empty( $terms ) ) { $output = array(); foreach ( $terms as $term ){ if( 0 != $term->parent ) $output[] = ‘<a href=”‘ . get_term_link( $term ) .'”>’ … Read more
Adding a query var to taxonomy term archive – gets redirected to the other taxonomy archive page
Insert them terms first using wp_insert_term, then associate them to the post.