How do I create a featured post within a custom post type?

Register a video post type and a “Featured Taxonomy” “Featured Custom Meta Select Box The Post type: function c3m_reg_vid_post() { $labels = array( ‘name’ => _x(‘Videos’, ‘post type general name’), ‘singular_name’ => _x(‘Video’, ‘post type singular name’), ‘add_new’ => _x(‘Add New’, ‘video’), ‘add_new_item’ => __(‘Add New Video’), ‘edit_item’ => __(‘Edit Video’), ‘new_item’ => __(‘New Video’), … Read more

wp_get_archives for a specific category?

I did this in a relatively complicated way using a custom query. I did not know about Smart Archives Reloaded so I wrote code myself. But it works. Replace your category ID for “term_taxonomy.term_id” <?php global $wpdb, $wp_locale; $query = “select YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts from $wpdb->posts, $wpdb->term_taxonomy, $wpdb->term_relationships WHERE … Read more

wp-admin slow in multisite

I ended up enabling WP_DEBUG and found an error – something about fsockopen() not being able to connect to my host (I didn’t write it down and now can’t reproduce it) – and found that it was a DNS issue;- my subdomain (foo.example.com) was resolving to the correct IP (10.0.0.1) but the primary domain wasn’t. … Read more

How to Save Different Usermeta Fields According to User Role?

Observation: following the guidelines suggested in this article, I’m trying to improve the quality both of the Q and the A. It’s a learning process… In your original code, you were displaying different input fields according to the user role and other conditionals. add_action( ‘show_user_profile’, ‘user_fields_for_admin’, 10); add_action( ‘edit_user_profile’, ‘user_fields_for_admin’, 10); function user_fields_for_admin( $user ){ … Read more

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