Widgets vs. Theme Mods

In short: It depends. Widget go into a widget area. But that also means that when you create a widget area any widget can be put there as well as any number of widgets. So if you’d make the logo a widget a user could put twenty different widgets in that spot, including stuff that … 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

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

How to change submit button value in comment from “Post Comment” to “Send”

Open comments.php file inside your theme’s folder <?php if ( comments_open() ) : ?> <?php $fields = array( ‘author’ => ‘<p class=”comment-form-author”>’ . ‘<label for=”author”>’ . __( ‘Name’, ‘responsive’ ) . ‘</label> ‘ . ( $req ? ‘<span class=”required”>*</span>’ : ” ) . ‘<input id=”author” name=”author” type=”text” value=”‘ . esc_attr( $commenter[‘comment_author’] ) . ‘” size=”30″ … Read more