Which post does a taxonomy term belongs to?

You could do it using the term_link filter. Something roughly as follows: function my_term_link($termlink, $term, $taxonomy) { global $post; if ($taxonomy == ‘my-custom-taxonomy’) { return get_permalink( $post->ID ) . ‘#’ . $term->term_id; } } while ( $programtype->have_posts() ) : $programtype->the_post(); $terms = get_the_terms( $post->ID, ‘my-custom-taxonomy’ ); add_filter(‘term_link’, ‘my_term_link’, 10, 3); foreach ($terms as $term) { … Read more

Allow non-logged in users to see a future post after clicking on a list of future posts

Try this: $my_query = new WP_Query(array( ‘post_status’ => ‘future’, ‘order’ => ‘DESC’, ‘posts_per_page’ => 1, )); while ($my_query->have_posts()) { $my_query->the_post(); the_date(); echo ‘ – ‘; the_title(); } wp_reset_postdata(); or this: http://wordpress.org/extend/plugins/show-future-posts-on-single-post/

Using default WP menu functionality to link to custom post-type listing?

Your best bet if you want them to show using the default drag and drop function is to register a custom taxonomy for the custom post type, http://codex.wordpress.org/Function_Reference/register_taxonomy. You can also use the taxonomies parameter when you register your CPT function. http://codex.wordpress.org/Function_Reference/register_post_type The alternative is to make a custom filter for your nav menu that … Read more

Querying both pages and posts

Use get_posts() or filter ‘pre_get_posts’ on the front page. Sample code for get_posts(): $my_post_array = get_posts( array ( ‘post_type’ => array ( ‘post’, ‘custom_type’ ) ) ); foreach ( $my_post_array as $post ) { // do something awesome … } There are also parameters for a custom order by meta fields and so on. A … Read more

Register widget only page is a singular of custom post type

Instead of nuking the entire widget, you should put your conditional statements within the widget itself: public function widget( $args, $instance ) { if ( is_singular( array( ‘post_type_a’, ‘post_type_b’ ) ) ) { // display your widget here } } Since you’re not printing $before_widget and $after_widget, there won’t be any output for this widget … Read more