How do I display a tag cloud with both post tags AND a custom taxonomy?

The following is a slightly modified version of the wp_tag_cloud() function: function custom_wp_tag_cloud( $args=”” ) { $defaults = array( ‘smallest’ => 8, ‘largest’ => 22, ‘unit’ => ‘pt’, ‘number’ => 45, ‘format’ => ‘flat’, ‘separator’ => “\n”, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘exclude’ => ”, ‘include’ => ”, ‘link’ => ‘view’, ‘taxonomy’ => ‘post_tag’, … Read more

Retrieve taxonomy terms in order of their post’s date?

I would use the terms_clauses filter, and then just use get_terms(): function wpse147412_order_terms_by_post_date( $pieces, $taxonomies, $args ) { global $wpdb; if ( ‘post_date’ !== $args[‘orderby’] ) { return $pieces; } $args = wp_parse_args( $args, array( ‘post_types’ => ‘post’ ) ); $pieces[‘fields’] = ‘DISTINCT ‘ . $pieces[‘fields’]; $pieces[‘join’] .= ” JOIN $wpdb->term_relationships AS tr ON tr.term_taxonomy_id … Read more

Add Taxonomy Values Within a Custom Post Type RSS Feed

get_post_meta is only for custom fields. If listing_category and listing_type are in fact taxonomies, you need to use get_the_terms instead. The resulting code would be something like this: add_action(‘rss2_item’, ‘yoursite_rss2_item’); function yoursite_rss2_item() { if (get_post_type()==’listings’) { $fields = array( ‘listing_bedrooms’, ‘listing_city’, ); $post_id = get_the_ID(); foreach($fields as $field) { if ($value = get_post_meta($post_id,$field,true)) { echo … Read more

How to show only Standard Format post in my custom taxonomy page -wordpress 3.8.1

Looking at your comment, photos and videos aren’t custom post types but actually categories. I’m changing my answer to reflect your comment. You can use pre_get_posts to exclude specific categories in your loop. You can achieve that with $query->set( ‘cat=-1,-2,-3′ ); This will exclude categories with ID’s 1, 2 and 3, and will only show … Read more

Hierarchical display of custom taxonomy

The wpse244577_list_terms() function below uses wp_list_categories() to do the heavy lifting, then modifies the results so that the terms are in reverse order of the hierarchy. Place this code in a plugin or your theme’s functions.php file: /** * Lists term links for a taxonomy in reverse order of hierarchy * * Based on https://developer.wordpress.org/reference/functions/wp_list_categories/#comment-1169 … Read more

I want to remove the links from the term list returned by get_the_term_list

You could use get_the_terms() and wp_sprintf_l(): function wpse_52878_term_list( $args = array() ) { $default = array ( ‘id’ => get_the_ID(), ‘taxonomy’ => ‘post_tag’, ‘before’ => ”, ‘after’ => ”, ); $options = array_merge( $default, $args ); $terms = get_the_terms( $options[‘id’], $options[‘taxonomy’] ); $list = array(); foreach ( $terms as $term ) { $list[] = $term->name; … Read more

Displaying related posts in a custom post type by a custom taxonomy

If you want to query for multiple taxonomy terms you can use the more advanced, tax_query argument of WP_Query queries. For instance //Get array of terms $terms = get_the_terms( $post->ID , ‘product_tags’, ‘string’); //Pluck out the IDs to get an array of IDS $term_ids = wp_list_pluck($terms,’term_id’); //Query posts with tax_query. Choose in ‘IN’ if want … Read more

Change order of WordPress tag cloud

Tags (terms) do not have a menu_order (see the design of the table in the DB). If you want to give terms a ‘menu_order’ you will need to create this yourself. As long as your WP is >= 4.4.0, you can make use of the feature term_meta. This is to terms what post meta is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)