WordPress has a function for this, called is_user_logged_in
. You use it like this:
if (is_user_logged_in())
echo '<a href="https://wordpress.stackexchange.com/questions/353228/account page">link text</a>';
else
echo '<a href="login page">link text</a>';
Related Posts:
- How exactly do automatic updates work?
- What is in media-template.php, and how does it work?
- Is it possible to disable a function of a parent theme?
- Variables declared in header not available in other includes
- Create Image Uploader for Widget
- WordPress Ajax always returns a 404 error
- Displaying a variable stored in functions.php inside widget
- Custom Meta Field – Youtube embed
- Need to get specific data from array
- Use different javascript files for each page on website
- Unable to post simple form data in HTML
- dynamic sidebar not showing anything
- javaScript in section of WP API
- PHP code to call image Caption, Alternative Text, and Decription?
- How to implement Google Tag Manager? [closed]
- How to rewrite URL with PHP variables with htaccess to a normal looking URL?
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Can’t get wp_insert_post to work
- Why not yield/iterable in posts interface?
- How to: PHP Log Out Link?
- 200 Rewrite blog post links
- PHP Fatal error: Uncaught mysqli_sql_exception: Table doesn’t exist in wordpress/wp-includes/wp-db.php
- code is skipping a div
- Avoid parallax images hardcoding
- The response is not a valid JSON response, wordpress problems?
- Firing schema via code in functions.php doesn’t work
- How to use wp_add_inline_style for custom CSS added via shortcode?
- Blog posts repeat
- Dot is not added at the end of href
- Getting error when using wp_insert_post()
- How to access variables from Functions file in theme files
- How can I modify footer when footer.php calls to another file?
- retrieve post data and insert it in seperate static html page without WordPress
- PHP conditional script issue
- My php code is not being executed
- Using Shortcode to Grab Archive Listing, Separate by Year
- working with term_relationships table
- Find Site ID From WP_Post
- How to show meta value code HTML after x paragraph
- How to use the wpsnonce clone post link?
- change the default order of posts only for specific categories
- Array to string conversion error in PHP 7.2 when returning user role as class
- Check class_exists before class definition / Doxygen problem
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- How can I get “Previous” and “Next” to show in the navigation besides the links?
- Splitting the_content() by size?
- with PHP within splits the link
- WordPress And High disk i/o
- Saving a post ID to use in a form elsewhere on website
- How to Fix an Archive.php That Displays All Posts?
- Dynamically replicate custom metabox in custom post type
- random reason on refresh
- How to tell if a user has gone in and created a menu
- Change Query Arguments (filter) with jQuery/Ajax or PHP?
- Using theme options to change a border-radius value
- can’t load .po file in functions.php
- WordPress Fresh Install Errors (Woocommerce specifically now)
- Tracking Visitor LatLng with WordPress using JS, PHP. How to put data which was extract using JS into DB
- Create shortcode for metabox gallery
- how do i add custom widget woocommerce shop page with php
- How can I redefine WordPress wp-content directory programmatically?
- Trim Titles Only On Some Pages
- code that I can run, or a plug in to show what sql tables something pulls information from
- Automatic email message after manual user approval
- Display attached images of a page or post that are insetred using gallery
- overwrite wordpress gallery with custom gallery shortcode
- Upgrade to PHP7.3 and Changing Apache from Prefork to Event Breaks WordPress
- Return author name as a tag using get_author
- How to pull date/time in french format for wordpress post?
- WooCommerce subcategories help
- Add wp posts to cutom masonry grid
- dynamically change content of div with php
- Custom WordPress Core upgrade through wp-cli
- What is wrong with this shortcode? to include external php file in WordPress posts
- add a value to an external link query in searchform
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- wp_query beginner
- Crop an image after upload on custom account page
- Migrating a live WordPress website to a Local Server: why some elements of the website are missing?
- Store stripe info as user_meta
- Showing the project type in HREF
- INCOMING: Wall of code for form and $_POST, not updating custom field’s value
- WooCommerce – Print Processing orders [closed]
- Loop returns more items than exist?
- Adding theme strings to .PO file
- Rewriting to a different page based on existence of query string?
- WP_Nav Highlight Parent Issue
- Host does not allow remote connection, so how do I transfer data to my WordPress site?
- I am extending Walker_Nav_Menu: How can I get the number of children elements of the current item?
- WordPress White Screen Error
- Set post to draft if matching word is found in the post
- Warning: filemtime(): stat failed for wp_
- How to transfer session after being redirected to other page
- Keep users logged in Without Remember Me
- How to use js variable to php in wordpress functions.php
- Display total count of products in orders of a specific order status
- Background Tasks in a WP Cronjob?
- How to execute a shortcode within a custom field?
- using custom pages for myaccount in woocommerce
- Putting form result in my database