Breadcrumbs – get the author?

Call echo $GLOBALS[‘wp_query’]->query_vars[‘author_name’]; and it should show you the author. You can also echo $GLOBALS[‘wp_query’]->post->post_author; or echo $GLOBALS[‘wp_query’]->queried_object->post_author;. hope i didn’t mix up with arrays and objects.

Display Notification Bar on Header on Certain Post Count

A simple way to achieve this would be to do something like the following; <?php $user_id = get_current_user_id(); $post_count = count_user_posts($user_id); if ($post_count >= 50 && $post_count < 100) { // Congratulations you have submitted 50 posts! } elseif ($post_count >= 100) { // etc etc… } else { // do something else, or nothing. … Read more

How can I merge two authors?

Delete one account. Upon deletion WP will prompt you with a question of whether to delete all posts by said author or attribute them to another user. Simple as that, wanted functionality is provided by the core.

How to conditionally hide author name on Single.php if category is “news”, otherwise if category is something else display author name?

is_category returns true if the current page being viewed is a category term page (i.e. a list of posts belonging to some term) and false otherwise. So inside single.php it will always return false. If you want to check if a the current post in the Loop belongs to some category term, then you need … Read more

Exclude some authors from query

Hey use this to grab all users excluding users with ID – 1,2,4 $blogusers = get_users(array(‘exclude’ => array(1,2,4))); Note – The function get_users_of_blog() is depricated, so it’d be good idea to use get_users() function which supports excludeing of users by their IDs.

How to get all possible arguments for a wordpress function

I think you are confusing function arguments with author (user) meta fields. To get all user meta fields you can use get_user_meta() with empty $key parameter. For example, for user with ID 45: $user_meta = get_user_meta( 45 ); $user_meta will be an array with all meta fields for the user with ID = 45.

Remove author link wherever author’s name is display

You have actually two problems to solve here: The first one is to remove the HTML link, which you are trying to achieve right now. As you read in the comments, it depends on your theme. You could find it looking for the exact HTML displayed around the author name (CSS classes etc), and then … Read more

How to implement friend system for WordPress?

BuddyPress can be used as a framework – it allows you to friend other users, and is a good place to start from. [Update] This is the structure of the BuddyPress friends table (bp_friends) CREATE TABLE `wp_bp_friends` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `initiator_user_id` bigint(20) NOT NULL, `friend_user_id` bigint(20) NOT NULL, `is_confirmed` tinyint(1) DEFAULT ‘0’, … Read more

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