Title: Boolean code required please
Last modified: February 7, 2021

---

# Boolean code required please

 *  Resolved [wittser](https://wordpress.org/support/users/wittser/)
 * (@wittser)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/boolean-code-required-please/)
 * Hi there
 * I have spent a whole evening trying to find the code required to generate the
   right boolean code to query if a custom field in my WordPress Divi site has a
   value, in the Content Visibility section, if it does then to display the social
   media button, if not to not display the button.
 * The field name is jv_team_instagram (and same for Twitter and Facebook) but I
   just cant create the correct code to achieve:
 * If jv_team_instagram is not null then set as true
 * Any help with this would be so appreciated as I have tried so many variations
   without any success?
 * Many many thanks in advance
    Dave
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fboolean-code-required-please%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Jonathan Horowitz](https://wordpress.org/support/users/jhorowitz/)
 * (@jhorowitz)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/boolean-code-required-please/#post-14026987)
 * Hi [@wittser](https://wordpress.org/support/users/wittser/),
 * Try this to show if the field is set:
    `in_array( 'jv_team_instagram', get_post_custom_keys())`.
 * That will test for the presence of the key regardless of value. To not show, 
   that field would need to be deleted/not present at all.
 *  Thread Starter [wittser](https://wordpress.org/support/users/wittser/)
 * (@wittser)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/boolean-code-required-please/#post-14027970)
 * Hi Jonathan
 * Thank you so much and I have tried this and the field is set and displays.
 * How do we achieve the validation so that the value of this field can be interrogated,
   i.e.
 * Field has a value – return a boolean 1/true
    or Field has NO value – return a
   boolean 0/false
 * Many thanks in advance
    Dave
 *  Plugin Author [Jonathan Horowitz](https://wordpress.org/support/users/jhorowitz/)
 * (@jhorowitz)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/boolean-code-required-please/#post-14028570)
 * Hi [@wittser](https://wordpress.org/support/users/wittser/),
 * Try `get_post_meta( get_the_ID(), 'jv_team_instagram', true ) !== ''`. 🙂
 *  Thread Starter [wittser](https://wordpress.org/support/users/wittser/)
 * (@wittser)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/boolean-code-required-please/#post-14033110)
 * That is brilliant, thank you so very very much. That has made an old man very
   very happy.
 * If you check out [http://www.wadebridgetownfc.co.uk/teams/1st-team/#squad](http://www.wadebridgetownfc.co.uk/teams/1st-team/#squad)
   you can see it in action by clicking on any of the profiles.
 * BTW – whilst there you can see (or not) the “read more” link text is red on a
   red background. How do I change the link text colour for the ‘read more’ element
   please so it displays effectively?
 * Many many thanks
    Dave 🙂
 *  Plugin Author [Jonathan Horowitz](https://wordpress.org/support/users/jhorowitz/)
 * (@jhorowitz)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/boolean-code-required-please/#post-14033187)
 * [@wittser](https://wordpress.org/support/users/wittser/) glad it worked for you!
 * In the Divi frontend builder, at the bottom of the page will be a circle with
   three dots. Click it, and then click the Cog icon (settings) to open up the page
   settings modal. On the advanced tab, there will be a Custom CSS section. You 
   can add this to change the links within those boxes:
 *     ```
       .et_pb_jv_team_content a {
         color: #edf000;
       }
       ```
   
 * It looks like that is a custom element in the Divi builder; the author should
   probably add a customization setting for link styles if it isn’t already there
   🙂
 * HTH!
 *  Thread Starter [wittser](https://wordpress.org/support/users/wittser/)
 * (@wittser)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/boolean-code-required-please/#post-14033354)
 * Thank you so much. You have me cooking on gas now. Complete star and great support
   🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Boolean code required please’ is closed to new replies.

 * ![](https://ps.w.org/content-visibility-for-divi-builder/assets/icon-256x256.
   png?rev=1359961)
 * [Content Visibility for Divi Builder](https://wordpress.org/plugins/content-visibility-for-divi-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/content-visibility-for-divi-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/content-visibility-for-divi-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/content-visibility-for-divi-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/content-visibility-for-divi-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/content-visibility-for-divi-builder/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [wittser](https://wordpress.org/support/users/wittser/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/boolean-code-required-please/#post-14033354)
 * Status: resolved