• Hi there,
    The plugin works great for some boolean expression as stated. But it doesn’t works well with ACF. Basically I am trying to get field from File field. As said earlier by previous thread we need to add expression for ACF in visibility
    function_exists('get_field') && get_field('field_name') && get_field('field_name) !== ''

    Tried with several methods but it didn’t worked well.

    Any help would be appreciated. Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I was able to use the Content Visibility plugin with Advanced Custom Fields without any issues. It was the exact solution I was looking for. Here’s the boolean expression that I entered into the Content Visibility text field:

    !empty(get_field(‘service_4_text’))

    My custom text field is called “service_4_text”, so I used the ACF function of get_field() and tested if the field is empty or not.

    Looking at the code above in your question, that seems like it does the same check as mine, except that it makes sure the get_field() function is available before using it.

    What is the name of your custom field?

    if(!empty(get_field(‘your_field_here’)) should hide the DIVI module if your field is empty and it will show the module if your field has content.

    Good luck!

    Kondor with a K, are you using multipl options on one page?

    We’ve been trying for 6 months to make this plugin work, it hides content when it shouldn’t and doesn’t hide content when it should. I’d be intrigued to know how you have made this work as all the ACF tickets I can see, there are users with the same problem.

    We are trying to create a template in DIVI Builder with 8 different headers and content fields that may or may not have content. At the moment we are having to display all of the areas and for many pages this is a lot of empty space.

    Thanks

    Steve

    The following worked for me setting the visibility on a divi section for a product page. My layout was overridden by the Divi Theme Builder. After some debugging it appears that the global $post object belongs to the Divi Theme builder not the rendered product page.

    !empty(get_post_meta(get_queried_object_id(), 'your_field', true))

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Doesn’t works with ACF’ is closed to new replies.