Have you tried printing your custom link just by checking if user is logged in? you can do this using bult in wp functions
<?php
if ( is_user_logged_in() ) {
echo '<a href="'.wp_logout_url( get_permalink() ).'" title="Logout" class="hunderline">Logout</a>';
} else {
echo '<a href="'.wp_login_url( get_permalink() ).'" title="Login" class="hunderline">Login</a>';
}
?>
Related Posts:
- Remote upload file to server B
- Replacing Icons in the Dashboard
- Using functions from a plugin in your theme
- Keep one user logged for a year?
- How to handel multiple checkbox field in the admin settings page with Settings API
- wp_insert_user – how to send verification email before logging in
- Post source link plugin – small modification
- How to turn off email you receive when registered?
- Execute a function using ajax
- While Using Static Pages, How Can I Get /blog into the URL of Each Post?
- Code in theme functions.php faster than with a plugin?
- Fatal error: Class not found in
- What’s the point of using WordPress’s built in admin-ajax.php?
- Converting a simple plugin to be placed inside of functions.php
- Override the core function locate_template
- Using plugin functionality in external php script not working
- Trying to count the total number of paragraphs inside a blog article
- greatest() function returns undefined property
- Override plugin with functions.php
- The Point of Using apply_filters()
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- How to include code into functions.php file via a plugin
- May i Use ShortCode in Template?
- Missing argument 3 for wp_register_sidebar_widget()
- Pass info from functions.php to plugin
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- add_query_arg not working
- Shortcode button dosent work for all posts. Work for first post only
- Is there a way I can find wordpress posts that don’t contain a word?
- Prevent shortcode from being wrapped in tags
- Inserting HTML tag with ACF into shortcode
- Theme my Login plugin, how to update fields
- Calling plugin function inside custom plugin for onclick event
- Show function to super admin
- get current date + 90 days and checking every day
- How to create an input field, and base the output on spreadsheet data? [closed]
- All sites themes functions.php have been changed
- Customize permalink wordpress category id
- Admin style for just one plugin in dashboard
- Grab WordPress Salt Data From URL
- Plugin is a widget, but I want to call it in the head, can I?
- Cannot get wpdb data (Error in a simple fuction) [closed]
- Basics of changing plugin output
- Why can’t I call a (member) function from within a foreach?
- Are there action hooks for comments?
- Return multiple values in a shortcode attribute
- Shortcode Attributes to Return different $_POST
- Plugin onclick button activate other plugin
- Activate and deactivate plugin automatically
- dynamic name of the style for wp_enqueue_style
- WordPress function to add text warning on every pages [closed]
- How to access OOP plugin function inside themes or other plugin
- Different registration form for different roles
- How can i list random author?
- Can you echo PHP code from a variable?
- Elementor Pro display featured image on section -> style -> image using shortcode
- Dynamic URL Rewrite for Custom
- Create a pdf from the entries in DB
- RSS feeds for specific topics
- add_rewrite_rule to load different page, without changing URL in browser
- Error using wordpress functions inside a plugin class
- Overriding a function in a WordPress plugin
- The function called on the wp head hook becomes null
- Submitting form to PHP
- Adding discount functionality to the cart
- Precheck fields when I add a new post
- How to detect 404 url and make this link underline or change background color?
- Get Shortcode output to database for static post_content
- Use buddypress function outside of plugin
- How use get_plugin_updates() function?
- how override a define
- How to Unhook actions/filters in within Class in plugin
- WPML – Hook when language is switched (change user language)
- Use action, filter, or hook to append HTML to WordPress plugin function
- Change custom rewrite rule when permalink is updated/changed
- How to disable/enable a plugin at a specific time
- Save Post Permalink In .txt File
- Dynamically Modify s2member Options
- How To Add Code To WP Without Plugin or Functions
- Disqus comments count taking long to update
- plugin not hooking to my custom hook
- Populate select option with JSON file
- Home page letters
- Find all strings between an enclosing shortcode
- Create csv file in plugin
- Load wordpress enviroment for external content?
- How to structure plugin in to functions?
- Trying to output a “Most visited blogs” list in wordpress multisite
- How to disable register and reset the password from WordPress admin panel?
- wordpress Search function is not working
- Adding a script & php to functions.php
- Override the plugin class and function
- Activate and deactivate two plugins automatically at certain hours
- PHP Creating a formula from mysql db values and db stored math operator
- How to disable plugin capability : “create new category”
- Option value not getting updated until page refresh in WordPress
- WordPress Custom Page Blog Template Pagination Problem (Pagination Not Displaying)
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode
- stop resize button for wordpress media
- Mixed results with is_page() WordPress function, when using $this, or self