When you are on an author.php
template page, you should be able to get the current author via $wp_query->get_queried_object()
. That is also what is_author()
uses when you want to check for a specific author.
Do you also have a question about setting the cookies? I don’t think WordPress has specific cookie functions. wp_setcookie()
is deprecated by wp_set_auth_cookie()
, but that seems to do more advanced stuff than just set a simple cookie.
If you use a specific visitor tracking system (like Google Analytics) I’m sure you can also save this kind of “lead” info with them. If you want to know more about that, the Pro Webmasters Stack Exchange site is probably a better place.
Related Posts:
- Function to return true if current page has child pages
- Cleaning up WordPress to improve performance?
- List of all theme customizer control types?
- Need help with friendly URL’s in WordPress
- Custom post status not working
- Keep one user logged for a year?
- Enabling Sessions in WordPress 3.0
- difference between esc_attr(), strip_slashes(), strip_tags()?
- How to preserve PHP modifications while upgrading WordPress?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Post source link plugin – small modification
- Getting $comments outside the comment template
- Change comments form title on a page by page basis
- How to let a single post have its own domain name
- simple wp_insert_post example
- Setting up the child theme so as to enable right-to-left WordPress?
- Prevent WordPress from loading comments
- delete an array element when its date expires
- Why is PHP Cookie via plugin only set when logged in as Admin and not regular users? and other questions
- How to add default images into theme customizer image control?
- Best way to pass arguments to another page in WordPress
- WP_Query with the “offset” argument
- WordPress change author email notify message?
- Set user loggin status?
- How do you output custom code between posts in the loop?
- Modifying Footnote Plugin for Descriptive Title Attributes
- Add filename to attachment page url
- Count widgets of a certain type
- Widget Javascript code (ajax)
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- How to break down importing of feeds
- How to remove tag cloud from taxonomy admin edit page?
- PHP can I add line numbers to file_get_contents()
- Setting custom canonical urls
- Setting a cookie upon specific URL visit
- Create simple Cookie Box for WordPress
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- How to customize a permalink (URL) structure?
- Converting HTML Template to WordPress Theme
- Edit Yoast SEO breadcrumbs output [closed]
- Access post meta in future_to_publish function
- Fastest way to get the comment and ping total count for a post
- want to create a subcategory.php to manage subcats
- How to combine wordpress_logged_in cookies in one cookie?
- How to check if a meta value has already been assigned to any user?
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- How to pick the default selected value in wordpress dropdown?
- how can i use $_COOKIE[] + PostID to execute the below code?
- Modify custom field input data before creating a new post
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Need help enqueueing webfonts
- Redirect to another page using contact form 7? [closed]
- How to obtain the current website URL in my theme?
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Create page template via functions.php?
- How to create a field in customize and show that in header.php?
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- Showing different pages depending on a cookie value
- How to make a cookie be on the whole site instead of being on a specific page/
- Is there a hack for using is_page() within the function.php file?
- Set cookie for visitor
- Customize field names in backend profile edit page through function.php [duplicate]
- Custom Database Table and foreach
- Problem with custom function from jQuery slider tutorial
- Different profile page by role
- WP-Bakery – Add custom colors to buttons with template colors
- implement custom roles in custom plugin
- Cookie value changes back to previous value after changing
- When is the wp-settings-[time] cookie generated?
- Post source link plugin – small modification
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- update_user_meta as multiple value but with same meta key
- Adding discount functionality to the cart
- How to assign a specific service to a specific provider based on location
- Precheck fields when I add a new post
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Delete post meta by serialized meta value
- working code, not working – Plugin Dev
- WordPress load javascript file if something… (after the page is loaded)
- Remove node from multisites?
- Automatically refresh page if widget is added to page?
- Stored meta from attachment, video length?
- Allow user to select location and then set cookie for location in WordPress
- Where can I find the declaration of `$_wp_theme_features`?
- How do I routinely extract the thumbnail of the most recent post?
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Use WP_Query Data In Cookie
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Edit a custom admin page
- Check if values exists DB
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- How can I clear the theme mod settings?
- Display a list of users with avatar filterable with alphabets
- Post thats in Two Categories, only want to display name for one
- Select area and checkbox data is not saving?
- WordPress: code structure
- WP Custom tables query
- Keep users logged in Without Remember Me
- Add multiple HTML attributes to an Elementor button