Display one post from each term in a custom taxonomy [closed]
Display one post from each term in a custom taxonomy [closed]
Display one post from each term in a custom taxonomy [closed]
Ok, so I will get negative points for this, but it should solve your problem, please dont be mad at me. Before anyone downvote me for this, I must say that I have nothing to do with the developers of this plugin: For custom taxonomies and custom post types I often use a plugin named … Read more
What TheDeadMedic said in the comments. A page would do the trick with a custom template. If you’re not wanting to mix these landing pages with actual pages – the wp-taxonomy-landing plugin/library should do the trick.
You’ll need to loop through your posts, use get_comments_number() to get the number of comments for each post, and then accumulate the total number of comments in a separate variable. e.g.: <?php $features_comment_count = 0; if ( have_posts() ) : while ( have_posts() ) : the_post(); $features_comment_count += get_comments_number(); endwhile; endif; ?> (I’ll assume that … Read more
For a menu object $item: $item->object stores the object the menu item refers to, e.g. ‘post’, ‘page’, ‘my-cpt’, or ‘my-taxonomy’ (the post type name, or the taxonomy name) $item->type stores what ‘type’ of object is it, either: ‘post_type’ or ‘taxonomy’. For custom links, these are both custom
Yes, the media library is long overdue an overhaul, and it seems there are some guys working on it right now. With any luck some changes will make it in to the next release. Take a look here at some of the slides and the many commments and feedback: http://make.wordpress.org/ui/2012/07/30/media-wireframes/
As noted in the OP’s comments, some non-ASCII characters may not be supported in term names under certain conditions. To replace all suspect characters with an underscore, use the following code: $categoryname = preg_replace(‘/[^a-z0-9]/i’, ‘_’, strtolower($categoryname)); wp_insert_term($categoryname, “department”); To replace all suspect characters with a dash, use the following code: $categoryname = preg_replace(‘/[^a-z0-9]/i’, ‘-‘, strtolower($categoryname)); … Read more
I just added a plugin to the WordPress Directory that removes the slug base for any custom taxonomy and the default category taxonomy. You can find it here – http://wordpress.org/extend/plugins/wp-no-taxonomy-base/
Here’s more of a complete guide based on the $wp_query object: The Taxonomy First you might want to know in which taxonomy you are, what its name is and retrieve all its available data from the object. // Taxonomy name $taxonomy = get_query_var( ‘taxonomy’ ); // Taxonomy object get_taxonomy( $taxonomy ); // Taxonomy name get_taxonomy( … Read more
Got some ideas for your requirement. Check below code… $parent=get_queried_object()->term_id; $child = get_categories(‘child_of=”.$parent. “&hide_empty=0&echo=0&taxonomy=custom_taxonomy’); if(count($child)>0){ $i=0; foreach ( $child as $row ) { $i++; echo ‘<li><a href=”‘.get_term_link($row,$row->taxonomy).'”>’.$row->name.'</a></li>’; if(count($child)==$i){ $args=array( ‘post_type’ => ‘custom_post’,’order’ => ‘DESC’, ‘posts_per_page’=>1,’tax_query’ => array( array(‘taxonomy’ => ‘custom_taxonomy’,’terms’ =>$row->term_id, ‘field’ => ‘id’ )) ); $second_query = new WP_Query( $args ); if ($second_query->have_posts()) : … Read more