Show selected value in a drop down menu

WordPress has a great little function built in for handling selections. <option <?php selected(‘value1’, ‘value2′);?> value=”foo”>Bar</option> You can also check out these form handling functions: checked() http://codex.wordpress.org/Function_Reference/checked disabled() http://codex.wordpress.org/Function_Reference/disabled Your HTML syntax is wrong as well. Per W3C, ‘value’ is not an attribute of the select tag. The value of a select is defined in … Read more

hide something in single page if current author has only one post

count_user_posts will give you the number of posts for an author. get_the_author_meta gives you the user’s ID. Note that this needs to be in The Loop to get the correct user. if( 1 < count_user_posts( get_the_author_meta( ‘ID’ ) , ‘post’ ) ) { echo ‘<div>blah blah blah</div>’; }

Author list ‘special’ author first then ‘normal’ author

The ‘special’ authors have in usermeta a meta key called ‘werksortgodmodus’ with meta value ‘yes’. The ‘rest’ of the authors have ‘werksortgodmodus’ = no . You could e.g. order by the meta value with (PHP versions 5.4+): $blogusers = get_users( [ ‘role’ => ‘author’, ‘meta_key’ => ‘werksortgodmodus’, ‘orderby’ => [ ‘meta_value’ => ‘DESC’, ‘display_name’ => … Read more

no emails for a user account

As far as I’m aware, it’s not possible via Add New under the Users tab, however, the wp_create_user function will let you create users without an email address: $username=”someuser”; $pass=”swordfish”; $new_user_id = wp_create_user( $username, $pass ); You’d have to wrap that in a basic plugin and provide some sort of UI for adding users.

Is it possible to get_terms by author?

Not directly, because terms are assigned to posts, not authors. You will need to query all posts, get their terms and authors, and then filter out terms which came with posts that have other authors than get_query_var(‘author’). Note that depending on the number of posts your site has, this kind of query could be very … Read more

How can I add “posted by ‘author'” to each post?

A plug-in might use the_content filter to append / prepend this, but if you’re a theme author or otherwise are able to edit the the theme templates directly. In this case you want to edit your theme’s single.php. (You can always check which template file is being used by a particular page using this answer: … Read more

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