How do I Make a custom post type get a custom post template in a plugin

function get_custom_post_type_template($single_template) { global $post; if ($post->post_type == ‘events’) { $single_template = dirname( __FILE__ ) . ‘/single-event.php’; } return $single_template; } add_filter( ‘single_template’, ‘get_custom_post_type_template’ ); Source Or you could use: add_filter( ‘template_include’, ‘single_event_template’, 99 ); function single_event_template( $template ) { if ( is_singular(‘event’) ) { $new_template = locate_template( array( ‘single-event.php’ ) ); if ( ” … Read more

How to hide/redirect the author page

You can do this at an earlier moment by hooking into the right action, like template_redirect, which fires right before the template will be displayed. add_action( ‘template_redirect’, ‘wpse14047_template_redirect’ ); function wpse14047_template_redirect() { if ( is_author() ) { $id = get_query_var( ‘author’ ); // get_usernumposts() is deprecated since 3.0 $post_count = count_user_posts( $id ); if ( … Read more

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