Custom Taxonomy terms with latest post ordered by date pagination issue

to change the number of posts per page you can do it in the wp dashboard like in this picture This function on functions.php works for me function tcPostsPerPage( $query ) { if (is_home()){$query->set(‘posts_per_page’, 6);} if (is_archive()){$query->set(‘posts_per_page’, 6);} } add_action( ‘pre_get_posts’, ‘tcPostsPerPage’ ); the two 6 is limiting to 6 per page, if this doest … Read more

Contact Form 7 – Populating dropdown list with terms relative to the post

Use the dynamic_dropdown tag functionality offered by the Smart Grid layout extension. The dynamic tag can take 3 sources of data (a given taxonomy, or branch within that taxonomy, a list of post titles, or the results of a filtered hook function). Use the filter hook to populated your dropdown as, add_filter(‘cf7sg_dynamic_dropdown_custom_options’, ‘filter_options’,10,3); function filter_options($options, … Read more

Problem with query_posts for a custom taxonomy in theme options

I see three things. if ( function_exists( ‘of_get_option’ ) ) : query_posts( ‘cat=” . $homepage_feature = of_get_option( “homepage_feature’ ) . ‘&posts_per_page=3’ ); You have a syntax error. There is no endif;. Maybe that is a typo, but maybe not. If you are trying to write a one-line if, remove the colon. Your title states “custom … Read more

Display custom taxonomy for product

Instead of using wp_tag_cloud pls try this in product page <?php $terms = get_the_terms( $post->ID , ‘city’ ); foreach ( $terms as $term ) { $term_link = get_term_link( $term, ‘city’ ); if( is_wp_error( $term_link ) ) continue; echo ‘<a href=”‘ . $term_link . ‘”>’ . $term->name . ‘</a>’; } ?>

Separator for multiple terms

If you need just the term names, fetch just the term names: use the field parameter for get_terms(). Build a comma separated list with an and between the last two items with wp_sprintf_l(). // get the term names $term_names = get_terms( ‘department’, array ( ‘fields’ => ‘names’ ) ); // glue the names with comma … Read more

Custom WP_Query breaks default behaviour of viewing right post associated with tax-term!

You second query performs an entirely new query and does not have the terms set. Besides, it’s not as efficient to ‘redo’ the query. Instead, hook into pre_get_posts and change the order there: function change_order_for_events( $query ) { //Check if currenty query is the ‘main query’ and event type taxonomy being viewed if ( $query->is_main_query() … Read more