Custom PHP Conditions

Using Custom PHP Conditions in Breakdance

This tutorial demonstrates how to use a custom PHP condition to hide content in Breakdance. This video shows how this can be done using WooCommerce functions to conditionally show or hide content.

Setting the PHP Condition

  1. Go to Settings > Conditions > Edit Conditions. This will open up the Conditions Popup.
  2. Click “+Add Condition”.
  3. Select the “Choose Condition” dropdown and select the “Custom PHP” condition.
  4. Click the “Open PHP Editor” button.
  5. Add the PHP for the condition.
  6. Close the PHP Editor
  7. Click the “Apply Conditions” button.

When writing custom PHP, you will generally want the code or function to return true for when you want content to show, and false for when you want it to be hidden.

Finalizing and Testing Your Custom Designs

After applying the condition, visit the page on the front end to see the conditions in action and verify that they are working correctly.

Additional Notes

This approach highlights the flexibility and power of Breakdance with custom PHP conditions, allowing for the creation of distinct layouts based on these conditions and enhancing both the user experience and the visual appeal of a site.