Update on April 15, 2020: Also added !=
operator.
This premium tutorial provides the steps to add a custom condition using which elements in Oxygen can be output based on the value of specific URL parameter like /?referrer=facebook.
Use Case
Let's say you want to output a section having for example, a welcome message on the front end only for users that visit your site from Facebook and you want to output another Section only for visitors that land on your Page after clicking through a link in Twitter.
To achieve this personalization, you
- define "referrer" query variable in WordPress
- register a condition that returns true if the URL parameter matches with the one user
enters in the condition - set
condition for your Oxygen sections i.e.,enter facebook
as the value of referrer URL parameter for the Facebook sectionand twitter
as the value of referrer URL parameter for Twitter section. - use referrer query variable in your URLs like
example.com/?referrer=facebook
andexample.com/?referrer=twitter
Caveat
This does not work on the homepage due to a bug in WordPress.
Step 1
Install and activate Code Snippets plugin.
Go to Snippets > Add New.
Title: Add "referrer" query variable
Code:
This is a premium members-only content.
To view the rest of the content, please sign up for membership ($47/month or $599 one-time).
Already a member? Log in below or here.