You’ll want to use a PHP if statement in combination with is_user_logged_in
If you’re editing your header try this:
<?php if (!is_user_logged_in()) { ?>
// Your social media icons code goes here
<?php } ?>
The exclamation point before is_user_logged_in()
means ‘is not’ in PHP, so your code essentially says, “If the user is not logged in, show the code between the brackets”.
Related Posts:
- Redirect to another page using contact form 7? [closed]
- get specific value of a array | PHP
- uncaught TypeError: Cannot read properties of null (reading ‘classList’) custom plugin
- Custom Plugin scripts from admin working in frontend
- Speeding up WordPress on a Local Network
- Caching of combined CSS and JS fails because of losing MIME types through combining by PHP
- How to set up php,javascript and css to allow for our finished product to be displayed within a page?
- How can I use WordPress functions in my stylesheet?
- How can I reduce the amount of files loaded/included per plugin?
- How to call plugin path in JS?
- Add CSS animation as Preloader to WordPress
- How to save Clicks of a download link button while it doesn’t matter if we refresh the page or again login/logout
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- How to use wp-ajax in wp-cron
- White text on white background in TinyMCE when wp_editor is called in WP 3.9
- Is it possible to filter the wp_footer() scripts, read the content, and insert them inline?
- Prevent CSS/JS loading when plugin is not used
- How can I make the “Preview Post” button save and preview in the same window?
- Creating an Exit Confirmation Popup
- Difference between register_block_type & wp.blocks.registerBlockType
- W3 Total Cache: Load CSS asynchronously for better PageSpeed score? [closed]
- Pass a php string to a javascript variable
- add mediaelement.js plugins into WordPress video player control bar
- Shortcode button dosent work for all posts. Work for first post only
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- Is there an earlier hook than login_head or login_enqueue_scripts?
- CSS from textarea in options page to frontend what to do
- Can someone please tell me what is wrong with my plugin?
- wordpress site | All-in-one-cufon IE Issue
- How to get the element ID from new menu list that added with add_filter()?
- Override Plugin Script Fucnction in WordPress
- Add a CSS class based on categroy id to archive pages
- Changing “elapsed time” to “time remaining” on MP3-jPlayer audio player with CSS or PHP changes
- add image crop function like in wp customizer
- Calculate price and display on woocommerce product single page under price (simple price, variable price) [closed]
- How to edit content before post update
- Bootstrap and Custom CSS in custom plugin are being overwritten by theme
- Delete mobile menu button [closed]
- Ability to automatically redirect a URL
- How to insert HTML/JavaScript form into WordPress page? [closed]
- How to get my plug-in, wrote in php, to refresh on its own every 5 minutes?
- Using TinyMCE in plugin?
- JavaScript in a PHP plugin
- wordpress add_action() issue in ajax call
- Get ‘Headers already sent’ error for the plugin I am creating when I try to login
- How to execute a plugin on a single page only?
- Pass user role to javascript code inside body
- How to get specific string/value from an array? php [closed]
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- How to make a dynamic css class whose name changes every visit to confuse scraper
- Background Music WP [closed]
- How to use custom Javascript code inside a plugin?
- Adding a simple Javascript file with a plugin
- Add logo to admin menu in my plugin
- Social share buttons text shows up on post excerpts
- How do I override all stylesheets and scripts without a plugin
- Plugin Admin panel checkbox unchecked after submit
- How do I minify a plugins CSS/JS code?
- Code for unique user visit count on every page WordPress
- Ajax call not working in wordpress through a plugin
- Send Array from JS to php file then insert it in wp database through a plugin
- Strange admin-ajax / CSS / $_SESSION issue
- Plugin or ways to limit number of users logging in the website,
- Possible way of having multiple Gutenberg instances for a page?
- Woocommerce add products to cart
- Overriding inline !important CSS with Javscript code snippet with media query
- Calling PHP function with AJAX
- Why does my custom plugin only function correctly once per page?
- How to get a specific string from a url
- How can I create a secure file download in WordPress?
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- make p tag collapsed after 3 rows
- Multiple image selection custom widget
- Custom Field used to allow a Free Story; no longer works
- Create a form and have custom menu display based on user answers?
- Woocommerce – Change variations output
- Conditional Fields depending on checkboxes
- Number format in thousands on highcharts in wpdatatable plugin
- How to remove a css class for any wordpress page
- Creating wordpress admin page panel [Theme Option]
- Embed Javascript code to registered users only
- How to limit each front-end user to view just his own uploaded files on Amazon S3?
- How to create a dashboard for logged-in users with custom functionality? [closed]
- Best use adding user generated JS/CSS to a theme with a plugin
- Creating a user ‘add custom field’ section
- Media Playlist Plugin
- How do I convince this button to do something when it is clicked?
- Possible jquery / library conflict in plugin usage
- contact 7 plugin stops some pages from working properly
- Can’t insert files in other inputs
- How do I output user_registered time in my correct timezone?
- How to tweak a plugin without preventing it from updating
- How to create post comparison in wordpress
- Eliminate Render blocking CSS?
- Adding a script & php to functions.php
- how to show selected options drop down menu values in attributes field in after saving post.php
- Refresh server side rendered block in Gutenberg without changing attributes or its content
- How do I call an action hook into wp_ajax hook callback function
- Option value not getting updated until page refresh in WordPress
- How to create a “Most Popular” & “Latest” TAB in WordPress