i add this code in index.php.
<div class="Div1"></div>. then write some css(absolution position) to the Div1. so when i login in my wordpress. the admin nav will push down some spaces to the site body. so the conetent shows unnormal. now, i want to add a class to <div class="Div1"> when logins. is there a way to get this.
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
|
|||
|
|
|
If you are using the
You can then use that class in your CSS to specify specific rules:
|
|||||
|
|
You can use jquery for this with a
And then use jquery to add class to div
So you would use this
Paste this in your functions.php file in the header.php or a plugin. Your choice. If the add class does not work try finding the div id that div1 class is inside of and use this instead 'jQuery("#divclassparent .Div1").addClass("logged-in");' |
||||
|
|