try something like this…
you need to first call global $post;
then get the author id like $author_id = $post->post_author;
Related Posts:
- How to use WP_Term with (menu) argument in the wp_nav_menu?
- Function/Class to list categories with checkboxes
- How can i call from custom fields to the category editor?
- How to change the hover content of a specific menu item on WordPress?
- how to search users by ajax live search
- Send push when new post is published in a certain category
- Remove unwanted elements for a wp_nav_menu
- How do I update a field of a meta box?
- How do I get the sub categories of the parent when in a sub category?
- How to add user details to different tables immediately after user registration
- mysql_real_escape_string() vs. esc_sql() in WordPress
- WordPress function get_the_terms() returns ‘Invalid taxonomy’ error
- Checking for existence of a page by title?
- how to get context information inside my funcion
- Filter Categories widget to allow custom sorting?
- Codex Version Focus on Production or Nightly?
- WordPress class, using add_action to call member function does not work
- Redirect to another page using contact form 7? [closed]
- How to modify files inside wp-includes directory in wordpress
- Fatal error: Call to a member function get_page_permastruct() on a non-object
- wp_get_post_terms Order by not working
- wp_get_theme Warning: Illegal offset type
- Why wp_die() doesn’t work with wp_redirect but exit() works
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Print Dashboard submenu name and filename
- Autogenerate a Table of Contents
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- WordPress multisite,use same cookies across all website?
- How can I show posts for a single category?
- Apply styles to blockquote element with the WYSIWYG editor
- Check if post belongs to any category
- Call to undefined function is_home() or any conditional tags
- unregister_setting() vs delete_option() for plugin update
- How to change WooCommerce loop product title HTML output in single product page and archive page
- How to display the categories on page using shortcode?
- How to display the category id along with category name on categories list?
- add_action pre_term_description vs. pre_category_description
- How to output functions from plugin inside theme
- wp_schedule_event is registered but function isn’t running
- How to show parents of current page category, excluding the category?
- Overwriting a plugin function
- WP Dropdown Categories, display subcategories but not grandchildren categories?
- Writing editor content to a file
- Load stylesheet in edit category page?
- Listing wordpress users with a search function
- How to relate the Category to user?
- How can i listing current category and Featured Category post list?
- How can i list random author?
- Remove Permalink Meta Box not working?
- Adding tables to dashboard pages programmatically?
- How to exclude categories from get_categories() select list inside a widget admin panel
- Setting post_id for single.php based on URL without a redirect
- using admin functions on frontend
- Javascript Function Called Too Early in PHP Script
- Modify code for functions.php with specific twitter user url and hashtags
- can’t access some WordPress function from my plugin
- How to Show Category List With Corresponding Links?
- WP 3-way voting system: On to something! Please help!
- Custom Settings Plugin Save foreach checkboxes
- Exclude Woocommerce Product Category From Sitemap
- Customise Grouped Product display in Woocommerce with custom column
- Change the behaviour of a button
- Can someone explain what’s the use of parse request function in WordPress?
- How to show only the last two categories in a menu?
- Add default value from selection
- function add custom fields to media gallery
- Determine if term is Category or Tag
- Override category archive page title (not the head title)
- Make visible page only in the trash
- How to check category name available or not
- Redirection from a specific page for users logged in but not with membership
- WordPress: I wanted to use Add rewrite rule multiple times for multiple CPT in my plugin
- Why would one specify multiple arguments when using get_previous_posts_link() which takes only one parameter?
- I cant add is_admin control to plugin
- delete category on plugin deactivation wordpress
- WordPress Ajax not returning Response
- Post is uncatagorized in publish_post action
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- Hide post by ‘post_category’
- Woocommerce product not appearing in category list page when created programatically [closed]
- Remove tag from all posts when publishing new post
- WordPress plugin how to run function when button is clicked
- Yoast and another plugin
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Add function to Dokan ajax class
- PHP get_category() function redeclared
- Making Woocommerce optimized for more than 500k products
- Add a new tag based on the category name in the publish event
- foreach argument to get specific file types getting too many returns
- Remove from a div by class name from post page if post author role is not administrator
- Function not working on any file other than the main plugin file
- Building WordPress Themes With Bootstrap with Adi Purdila → TutsPlus
- Ajax not working to insert, query and result data
- Template file structure , wordpress hook for altering the template
- WordPress permalink setting
- How can I see a varibles value when my plugin runs?
- How can I add recent posts to menu like mashable
- Creating an archive page listing external data
- Why is ‘register_activation_hook’ undefined?
- Dynamic banner for use on external sites