Linking to Post Types from wp-admin

The following should do the trick: <a href=”https://wordpress.stackexchange.com/questions/35141/<?php admin_url(“https://wordpress.stackexchange.com/questions/35141/edit.php?post_type=slides”) ?>”>Slides</a> It’s how it’s done in the source code. The function admin_url() appends the proper admin address. The output of the url should be: http://www.mysite.com/wp-admin/edit.php?post_type=slides

Inefficient Query Confusion

…or try this: // … put your $today and $future variables here… global $wpdb; $events = $wpdb->get_results( ” SELECT * FROM {$wpdb->posts} LEFT JOIN( SELECT DISTINCT post_id, (SELECT CAST(meta_value AS DATE) FROM {$wpdb->postmeta} WHERE {$wpdb->postmeta}.post_id = meta.post_id AND meta_key =’opening_time’) AS opening_time, (SELECT CAST(meta_value AS DATE) FROM {$wpdb->postmeta} WHERE {$wpdb->postmeta}.post_id = meta.post_id AND meta_key =’artist_talk_time’) … Read more

Alphabetically sort a taxonomy.php template by post title

you can query_posts and orderby=title: <?php //*The Query*// $paged = ( get_query_var( ‘paged’ ) ) ? get_query_var( ‘paged’ ) : 1; query_posts($query_string . ‘&post_type=YOUR-POST-TYPE&posts_per_page=1&orderby=title&order=asc&paged=’.$paged); if(have_posts()) : while(have_posts()) : the_post(); ?> <?php endwhile; ?> <?php else : ?> <?php endif; wp_reset_query(); ?> more info: WP_Query#Order/Orderby Parameters

Merge page with custom post type

I don’t see anything wrong with using archive-$cpt_name.php as your default archive page for the custom post type. That would be the correct way to go about doing it. Although there are many different methods to do it, I think you are on the right track to the best way.

TinyMCE Buttons on Certain Post Type

This is used in one of my plugins and working well, hopefully it can draw some inspiration: public function efpd_run_tinymce(){ global $typenow, $pagenow; if ( empty( $typenow ) && !empty( $_GET[‘post’] ) ) { $post = get_post( $_GET[‘post’] ); $typenow = $post->post_type; } $curpage = $pagenow . ‘post-new.php?post_type=” . $typenow; if( “fanpages’ == $typenow || … Read more