Visibility Condition Fragments Bug

Hi there,

using the default header part and adding it to the global header fragment I am unable to hide the header with the conditions in the image below. Other options work, like user ID.

Cheers

Environment info

  • Chrome
  • WordPress version: 6.4.3
  • Cwicly Plugin version: 1.4.2

Hi @T-low,

I think there may be a slight misunderstanding about how conditions work. Your conditions basically show in all cases because you are not doing anything to negate them.

If you want to hide for guests, you will want to add a “Do not show if”:

1 Like

Hi @StrangeTech,

thank you for your reply :+1:

Does this work for you?


I tried with a new local Laragon installation and could still see the header when logged out/ Incognito mode.

image

I only have Cwicly version 1.4.1.2 installed and no caching is active on the wordpress site.

I tested this with Chrome and multiple devices :thinking:

Cheers

I don’t have time to test right now, I know there were some issues with this in the past. If it is not working, here are a couple of possible alternatives that may work:

  1. Use username instead:

Screenshot 2024-04-02 at 09.26.20

  1. Create a shortcode and inside of it call the function in the second condition shown in the following screenshot:

a) Create a shortcode that calls this function:

See here for where to do those:

b) Add a shortcode condition based on what you created in step a:

Screenshot 2024-04-02 at 09.28.01

1 Like

Hi @StrangeTech,

thank you for the reply and all the helpful links.

I used the shortcode option before, but when testing I thought this might be a bug, hence the report.

As your feedback post reads, it seems to be true that this is a bug? So I will leave it as such.

Was a little sad that I saw a function return, but it was not available in the visibility conditioning.

Cheers

Hey there,
picking up this topic since I am also facing issues here.

I want to create a preview for a modal which should appear on the home page of the site. However, the mentioned conditions “user logged in” doesn’t work (in any combination). I think that this is still kind of a bug, no?

Creating a shortcode is a nice workaround, but i would prefer to use the built-in conditions :slight_smile:

1 Like

Hello @Wolfgang,

Thanks for bringing this up again.
Definitely a bug on global fragments that will be fixed in the next update.

Thanks to @T-low for the initial report.

Cheers,

1 Like

Hey @Louis,
thanks a lot!

For others facing that issue and just want to produce a preview (for client review). I didn’t want to make a shortcode, cause I tend to forget to delete such kind of stuff, so another solution would be to create a condition with URL Parameter and set it to review-preview with a value of true for example.

Then you can visit your page with ?review-preview=true

Just in case that someone needs that.

1 Like

Hello @T-low,

Thanks for your patience on this one :see_no_evil:

The issue should be fixed in 1.4.2.

If you still have trouble, please don’t hesitate to let me know by replying to this thread.

2 Likes

Wow, great one to fix! Nicely done @Louis!

1 Like