WPCode Logo

WPCode Blog

Everything you need to know about the WPCode plugin

Conditional Logic Just Got A New Look With Added Functionality In WPCode v2.2.0

Conditional Logic Just Got A New Look With Added Functionality In WPCode v2.2.0 

Do you want to add code snippets to your website with unprecedented precision?

You now have the ability to use query parameters in Page URL Conditional Logic to target specific pages of your website more precisely. This new feature lets you insert code snippets into areas never possible before! 

Also, the Conditional Logic picker has got a new look so you can find and select the appropriate rule more easily and quickly. 

Let’s learn all about these exciting updates in WPCode v2.2.0!

Introducing Query Parameters In Conditional Logic

Using WPCode, you can already insert code snippets to any page of your website using the Conditional Logic rule: Page URL. We are taking this feature to the next level. From now on, you will be able to add code snippets in posts/pages when certain conditions are met using query parameters.

Query parameters modify the content or behaviour of a web page by passing additional information in the URL. For example, while “https://example.com/products” shows all the products of an eCommerce website, “https://example.com/products/?type=laptop&brand=Apple” only shows Apple laptops.

Now that WPCode supports query parameters, you can add multiple code snippets to the same page based on specific scenarios. For instance, you can show different banners to visitors from different campaigns. What’s more, you can use this feature not only on the front end but also on the back end admin area using the Admin Header and Admin Footer locations.

How To Use Query Parameters In Conditional Logic?

Since query parameters are a form of URLs, you can configure them similarly to how you set up the Page URL Conditional Logic rules. Here’s a step-by-step guide to setting it up:

  1. Create Your Code Snippet: Begin by creating a new code snippet or editing an existing one.
  2. Navigate to Smart Conditional Logic: Scroll down to the “Smart Conditional Logic” section in your snippet editor.
  3. Enable Conditional Logic: Toggle on the “Enable Logic” option.
  4. Configure the Condition: Based on your requirement, decide whether you want to “Show” or “Hide” the snippet.
  5. Select Page URL: From the dropdown menu, choose “Page URL” as your condition type.
  6. Set URL Match Type: Select how the URL should match from options such as “Is/Is Not/Contains/Doesn’t Contain.”
  7. Enter the URL with Query Parameters: Write/paste the URL that includes the query parameters into the designated field.
Conditional Logic Just Got A New Look With Added Functionality In WPCode v2.2.0: How to add query param in Page URL

Conditional Logic Picker Got A New Look!

We’ve redesigned the Conditional Logic picker to enhance usability and efficiency. Conditional Logic rules are now categorized into four distinct groups, allowing you to locate the specific logic you need more easily. Additionally, the search box eliminates the need to browse through all available rules. Simply type in what you’re looking for and select the desired conditional logic directly.

Conditional Logic Just Got A New Look With Added Functionality In WPCode v2.2.0: Redesigned Conditional Logic

Closing Notes

We have introduced these new enhancements so you can add code snippets to your website more precisely. We believe the support for query parameters and the redesigned Conditional Logic picker, will significantly elevate your website customization ability and help you stay ahead of your competitors.

Upgrade to WPCode Pro now to customize your website like never before!

Add A Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.


Get WPCode

Popular Resources

Get free tips and resources right in your inbox, along with 500+ others

Follow Us

Get Started Today & Add Your Own Snippets

Future-proof your website with WPCode Snippets and improve the way you manage code across all your websites.