You need to use the body_class()
:
http://codex.wordpress.org/Function_Reference/body_class
If you use the function body_class()
you can set on your css like this:
.example {
display: none;
}
.logged-in .example {
display: block
}
Related Posts:
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- different style sheet for just one page template
- Can’t call Javascript function – scope?
- Custom styles.css sheet for visual editor
- Is my code correct to enqueue CSS on a specific page?
- Changing parent element’s class or style
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- header_image() with CSS
- echo custom fields with AJAX
- Not all CSS elements transferring via parent to child?
- Adding jQuery datepicker to Custom Post Type Metabox [closed]
- Split Media Queries in different files!
- Some questions about how proper add 2 CSS file in a WordPress theme?
- In jquery use php variable to execute an enqueued jquery file
- JQuery undefined and Stylesheet loads in bottom along with js files
- problem loading stylesheets to wp_head dynamically
- Run a jquery script on on a certain template page
- Add php code to wp_print_scripts?
- How can i unload effect.min.js file?
- wp_enqueue_script | Help me figure out what is causing jQuery is not defined
- How to insert class in each list of categories?
- Parent theme styles overriding child theme CSS [closed]
- I can’t add CSS with functions.php
- Where is this JQuery coming from?
- Theme JS is available but theme CSS isn’t
- Proper Way to Load stylesheet on Condition
- Default Nav Highlight
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- Custom styles in Tiny MCE with an external CSS file
- why can’t i add front.css to my frontpage.php
- How to load jQuery in TOP of wp_footer?
- get_template_directory_uri() links to child theme not parent
- Passing Jquery value to WordPress function
- WordPress can’t get jquery/unslider to work
- Add loggedout class on body using a function or JS
- remove/hide wp-editor
- Are innerHTML elements visible to jQuery functions?
- Getting out side of wp root folder from function.php using absolute path
- Include Jquery libraries in wordpress theme?
- Page Template Won’t Load Correct CSS File
- current_page_item is missing inside wp_nav_menu
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- get content from page through AJAX
- Creating multiple category drop down
- define css class in functions.php
- How to setup a popup registeration page in wordpress with function.php
- colorbox not loading in
- How to add php within jquery
- Help with IF has focus then… statment
- Get URLs for AJAX Filter Checkboxes WordPress
- Completely Disable WordPress RSS Feeds
- wp_set_object_term via js btn frontend
- Advanced method to control cache of enqueued style/script
- Combine page types and Custom Taxonomy in a functions.php command
- Populate Product Regular Price with a calculated ACF Field Value
- Can’t load assets
- Hide ‘add to cart’ when certain value in dropdown is selected
- Ajax Form Issues using Lightsail (AWS)
- What is the earliest Hook a Script can use?
- WordPress does not load jQuery
- How to reference different css (bootstrap) stylesheets for the header and body of a page?
- post value to function with Ajax and jQuery
- Can we have conditional CSS styling?
- CSS style and app.js not loading
- Post content overflows on my mobile phone
- Stylesheet does not load despite functions.php
- Remove clickable Link of WordPress Site Logo from Woocommerce Single Product page
- How do I make a custom “Read More Blogs” button for my blog page
- function class doesnt work
- Help using ShortCodes to style whole chunks of the post
- Images with overlay
- Setting Up Child Theme To Take Priority
- how to remove a tag in the_category function
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- How to use `foreach()` in ajax call
- CSS disabled after getting rid of emoji
- How to add styles in existing function?
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- Woocommerce – Switching Price for Category
- Multiple Notifications SetInterval
- Adding a class to the body of an inactive site using multisite
- Conditionally apply css for a specific template part
- How do i create a search option for pdf’s only
- How do I dequeue a Stylesheet, stored in an ‘Assets’ folder?
- WordPress Ajaxifying not working properly
- Execute jQuery with custom event listener after successfully add an item to the cart
- Child Theme not loading multiple stylesheets
- Load scripts into an AJAX div
- Load scripts into an AJAX div
- Correct way of Enqueue self hosted fonts in sass project
- Help with is_page() and calling css for specific pages in a Child Theme
- Child theme style.css didn’t work properly but the Customize Additional CSS did [closed]
- True parameter but jquery register in header and not in the footer with wp_register_script
- How to automatically add custom classes to headings in content area
- Automatic add space if user enters number(any digit)
- WordPress Jquery+scripts enqueue issue
- Moving CDN jQuery to footer does not work?
- Adding a jQuery rotator function
- Changing the color of post title [closed]
- Why are some custom javascript files working but some are not