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:
- How to export comments in WordPress?
- How can I call a function from one plugin within another plugin?
- Gutenberg disallow certain custom blocks but keep all core blocks?
- Publish author posts only with editor approval?
- Replacing Icons in the Dashboard
- Customizing subject in comment notification e-mails
- WP showing “warning: call_user_func_array()”, What to do?
- Declare a function before plugin does on the theme functions.php file
- Generate Advanced Custom Fields box in custom admin menu page
- Removing user contact methods works from functions.php but not from a plugin
- While Using Static Pages, How Can I Get /blog into the URL of Each Post?
- Use functionality of 2 wordpress plugins
- Fatal error: Class not found in
- What’s the point of using WordPress’s built in admin-ajax.php?
- How can i change an image’s author?
- Converting a simple plugin to be placed inside of functions.php
- Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory
- Showing Co-Authors on post page
- jQuery Plugin to use WordPress functions in AJAX request
- Using plugin functionality in external php script not working
- greatest() function returns undefined property
- Debugging Technique Question re: functions.php
- Override plugin with functions.php
- The Point of Using apply_filters()
- WP Job Manager Category Drop-down; Change Placeholder Text Via Filter
- Custom Taxonomy Tag Search
- Missing argument 3 for wp_register_sidebar_widget()
- Redeclare theme’s function in a plugin
- I have functions in my wordpress plugin. How do I get them to work for me?
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- 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
- Change wordpress current_time function to different timezone
- How to override a plugin function wrapped in a class?
- Edit Yoast SEO breadcrumbs output [closed]
- Snippets: is it better to add them in functions.php or make site-specific plugins?
- Using a post-signup hook to get user details
- Restrict media upload size by format
- Facebook Messager Plugin
- All sites themes functions.php have been changed
- Grab WordPress Salt Data From URL
- Basics of changing plugin output
- Why can’t I call a (member) function from within a foreach?
- Are there action hooks for comments?
- Help with WP Business Directory Manager Plugin?
- Return multiple values in a shortcode attribute
- get specific value of a array | PHP
- Shortcode Attributes to Return different $_POST
- Plugin onclick button activate other plugin
- Loading a plugin’s js file from functions.php
- Activate and deactivate plugin automatically
- dynamic name of the style for wp_enqueue_style
- WordPress function to add text warning on every pages [closed]
- Different registration form for different roles
- Defining the value of a variable before a function?
- Elementor Pro display featured image on section -> style -> image using shortcode
- How to get custom minimum price in Woocommerce
- 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
- Share my WordPress plugin for updating how?
- Overriding a function in a WordPress plugin
- 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
- working code, not working – Plugin Dev
- Use buddypress function outside of plugin
- 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
- Configuring default woo commerce login with modal popup
- Save Post Permalink In .txt File
- Dynamically Modify s2member Options
- register_activation_hook doesn’t fire at all
- How To Add Code To WP Without Plugin or Functions
- My ajax request don´t work and return 0
- How can I add a custom checkbox / radio button on the admin theme options to display a CSS or other?
- How to delete posts older than one year with post meta, post attachments and files?
- 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
- How do add_action and WP_Query
- Trying to output a “Most visited blogs” list in wordpress multisite
- wordpress Search function is not working
- What is wrong with this dbDelta syntax?
- 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
- Make plugin admin page visible to other roles
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)
- wp_enqueue_script doesn’t load JS in plugin