Menu - Fix on Screen

Stagger Lee
1796 Posts
Stagger Lee posted this 31 March 2015

I see Admin bar is not considered inside calculations, so Menu bar goes a bit under Admin bar if User is logged.
Can you use something like this to calculate for Admin bar for Logged users, or Users that have access to Admin bar.
Here is Page blocj pushed down same amount od PX too. Honestly I dont know how you can solve it. It would be nice if Admin bar could be considered stealing space from Menu bar, and Menu bar not goes under Admin bar.

Maybe there is simplier methods than my snippet, but cannot remember now anything. Maybe something with pure CSS code that will detect Admin bar and adapt according.

Cannot add code here !

is_user_logged_in()
style type="text/css"
.top-menu{top: 32px !important;}
#page {margin-top: 48px !important;}
style

I see Admin bar is not considered inside calculations, so Menu bar goes a bit under Admin bar if User is logged. Can you use something like this to calculate for Admin bar for Logged users, or Users that have access to Admin bar. Here is Page blocj pushed down same amount od PX too. Honestly I dont know how you can solve it. It would be nice if Admin bar could be considered stealing space from Menu bar, and Menu bar not goes under Admin bar. Maybe there is simplier methods than my snippet, but cannot remember now anything. Maybe something with pure CSS code that will detect Admin bar and adapt according. Cannot add code here ! is_user_logged_in() style type="text/css" .top-menu{top: 32px !important;} #page {margin-top: 48px !important;} style

Last edited 31 March 2015 by Stagger Lee

Vote to pay developers attention to this features or issue.
6 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 01 April 2015

Hello Lee,
you may try the following solution.
Please note, that it requires custom changes in the exported theme files, namely in home.php, index.php, page.php. Add the code line

<?php if ( is_user_logged_in() ) {echo "<style>.affix { margin-top: 32px; }</style>"; } ?>   

right before the </head> tag:

...
<?php wp_head(); ?>
<?php if ( is_user_logged_in() ) {echo "&lt;style>.affix { margin-top: 32px; }</style>"; } ?>   
</head>

You may adapt the CSS style if needed, this one is OK for default Themler theme with fixed menu.

Regards,
Aileen

Hello Lee, you may try the following solution. Please note, that it requires custom changes in the exported theme files, namely in home.php, index.php, page.php. Add the code line <?php if ( is_user_logged_in() ) {echo "<style>.affix { margin-top: 32px; }</style>"; } ?> right before the `</head>` tag: ... <?php wp_head(); ?> <?php if ( is_user_logged_in() ) {echo "&lt;style>.affix { margin-top: 32px; }</style>"; } ?> </head> You may adapt the CSS style if needed, this one is OK for default Themler theme with fixed menu. Regards, Aileen

Last edited 14 April 2015 by Support Team

Stagger Lee
1796 Posts
Stagger Lee posted this 01 April 2015

Thank you Aileen
Before you continue working on Themler can you do something about code parser here at forum. It would be pitty it ends useless as support forum, as Artisteer forum did. Better to do it now, later will be much more difficult.

Thank you Aileen Before you continue working on Themler can you do something about code parser here at forum. It would be pitty it ends useless as support forum, as Artisteer forum did. Better to do it now, later will be much more difficult.
Support Team
Support Team posted this 01 April 2015

Hi Lee,
I see the problem with code formatting, I've just passed it to our developer team.

Regards,
Aileen

Hi Lee, I see the problem with code formatting, I've just passed it to our developer team. Regards, Aileen
Support Team
Support Team posted this 01 April 2015

Please check my response. It it being output as it should now.

Regards,
Aileen

Please check my response. It it being output as it should now. Regards, Aileen
Stagger Lee
1796 Posts
Stagger Lee posted this 01 April 2015

Can you give a tip how you did it ? Code form my first comment I could not parse right no matter what I tried.

Can you give a tip how you did it ? Code form my first comment I could not parse right no matter what I tried.
Support Team
Support Team posted this 01 April 2015

Hi Lee,
as temporary workaround use "& lt;" , "& gt;" (without space) instead of "<", ">" inside code blocks. Remember to mark them as "code" as well.

Regards,
Aileen

Hi Lee, as temporary workaround use "& lt;" , "& gt;" (without space) instead of "&lt;", "&gt;" inside code blocks. Remember to mark them as "code" as well. Regards, Aileen
You must log in or register to leave comments