Support » Plugin: Content Visibility for Divi Builder » Custom Querystring support

  • Resolved kevinmt

    (@kevinmt)


    If I want to pass a single querystring variable ie my.com/fruits/?fruit=apple
    can I add the customer variable of fruit and use the plugin to conditionally show or hide an image element? Also will this work if I am using a Pretty URL rewrite plugin?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jonathan Horowitz

    (@jhorowitz)

    Hi @kevinmt,

    You could use isset( $_GET['fruit'] ) && $_GET['fruit'] === 'apple' to show if ?fruit=apple is present in the URL.

    I would say a url rewrite plugin might affect it if it strips the param… what would the final url look like?

    Thread Starter kevinmt

    (@kevinmt)

    URL rewrite version :mysite.com/fruit/apple
    Querystring version :mysite.com/?fruit=apple

    URL rewrite version :mysite.com/pet/cat
    Querystring version :mysite.com/?pet=dog

    The querystring params I believe will be passed to the page and the URL rewrite makes i look pretty in the URL bar…. hence the name pretty permalinks…..

    I will try this later today and let you know my results but it looks like it will do what I need! Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Querystring support’ is closed to new replies.