Left Bar Condition

Hello Theme.co Team,

It’s about the left bars in the header.

If I set a condition for an upper bar, e.g. Show only if the user is logged in, it works fine.
If I set this condition on a left bar, the empty wrapper remains.

Bildschirmfoto 2021-04-14 um 08.08.08

Bildschirmfoto 2021-04-14 um 08.07.09

So if no conditions apply, the bar should disappear completely as it is the case with the upper bars.

@regnalf

Hi @Regnalf,

Thanks for reaching out!

Would you mind sharing your admin credentials so that we can check the back-end settings? To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts.

Thank you.

You have access now, there is only one header, and you can find the conditions in the left bar.

Hello @Regnalf,

The Fixed Left navbar still displays because you only have added the condition in the bar element.

Please create two sets of the header. One that has the top navbar only and the second one that has the top navbar and the fixed left navbar. You should be applying the condition to the whole custom header so that appropriate header will display.

Hope this makes sense.

I know what you’re getting at, but that would mean that when you make changes to the top bar, you have to look at both headers! This would mean an unnecessary source of failures if one no longer remembers this combination.

I would still ask to use this functionality as with the upper bars that the bar disappears completely when the condition requires it. It is also meaningful from the logic, because otherwise the conditions would make no sense with the left bar!

Hi @Regnalf,

My colleague is quite correct to show the Left bar for the Members only you need to add the conditions into the Header. Adding condition to the bar element will not applied to the Header which actually makes the Left Bar section.

Thanks for understanding.

Then the condition button on the left (or right) bar element is useless! This is a bug, not a feature!

So i kindly ask you to add this as a bug report or remove the condition button.

@regnalf

Hello @Regnalf,

This isn’t a bug. We have intended to add the condition for the entire header. We do not have a condition for each of the header placements (top, left, right, and bottom). What we do have is the condition for the bar element.

If you do not want to edit two headers when there are certain changes to be made, you can make use of the global blocks. Create your desired navbar design as a global block. You can create two sets of the header and use the same global block in each of the headers. One that has the top navbar only and the second one that has the top navbar and the fixed left navbar. You should be applying the condition to the whole custom header so that the appropriate header will display.

Hope this makes sense.

I don’t know why we are talking at cross purposes. Yes, I know there is no condition for the superior display of an upper, left, right or lower header.

But there is a condition for each bar.
If I set such a condition for the upper bars it works without problems:


Bildschirmfoto 2021-04-16 um 08.51.41
Bildschirmfoto 2021-04-16 um 08.52.57

Example for not logged in users:

Bildschirmfoto 2021-04-16 um 08.53.58
Bildschirmfoto 2021-04-16 um 08.53.49

And if I set both to logged in only, the top header disappears completely.

Bildschirmfoto 2021-04-16 um 08.59.40

The problem with the left bar is not that the condition would not make it disappear, it already does. It is because another element is created outside the header area which does not disappear!

Bildschirmfoto 2021-04-16 um 08.57.36

If you remove this element, the left bar is gone as it should be.
So my temporary solution is to set a CSS display: none; on this element with the corresponding condition. But this should already be done by the theme!

I hope I could express myself better now.

@Regnalf

Hello @Regnalf,

There is no option available to set the condition on the Header Position that is Top, Left, Right and Bottom Header. You can only set the condition on the Header’s Bar element.

Thanks for understanding

That’s what I write about all the time!

  • The point is that the left column allows a single bar.
  • I can assign a condition to this bar.
  • This is also executed and the bar disappears.
  • But there is an empty area left when the bar disappears, because of the extra element.

I have not written about an option regarding the position of the headers!

For all who need this functionality too use this code:

function wp_head_custom()
{
   	if (! is_user_logged_in())
		{
		?>
		<style>
			.x-bar-space {display: none !important;}
		</style>
		<?php
		}
}
add_action('wp_head', 'wp_head_custom');

Note: use x-bar-space-left for left header specific!

Thanks for letting us know!

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.