Home › Forums › WPStudio Plugins › Introducing "GutenLogic" › Reply To: Introducing "GutenLogic"
August 20, 2021 at 11:14 pm
#17019
Benjamin
Keymaster
You can use the following types of PHP instructions in GutenLogic:
- Use regular WordPress Conditional Tags
- You can use the ! exclamation point to "reverse" the logic statement.
!is_front_page()
returns true when the visitor is NOT on the frontpage. - You can combine conditions using the || (pipes) for an OR statement that returns true if EITHER statement #1 or Statement #2 is true.
- You can combine with more specific condition using the && (double ampersand) to return true if BOTH statement #1 and statement #2 are true.
- And all the traditional WordPress conditional tags work like
is_home()
,is_page(array(3,6,7))
,is_user_logged_in()
- You can use the ! exclamation point to "reverse" the logic statement.
- You can also evaluate a statement to check a server-level condition like checking to see if a visitor is coming from duckduckgo.com using the code
strpos($_SERVER['HTTP_REFERER'], "duckduckgo.com")!=false
- You could even go as far as returning true if a page is a "child" of a certain post ID using code
global $post; return (in_array(234,get_post_ancestors($post)));
So, as you can see, the capabilities of the GutenLogic is extensive if you are willing to think through the power it opens.