Utilizing Shortcodes to Hide/Unhide Rows in Cornerstone

Hi, i’m currently using WP Engines Geo-Targeting functionality that allows to hide/show content on the a page using their shortcodes (https://wpengine.com/support/developers-guide-geotarget/)

For example: [geoip-content region=“NY”]This content will only be shown if the user is located in NY[/geoip-content]

What i’m having trouble with is adding shortcodes to a page built using Cornerstone. Like in Visual Composer, you can edit the raw data of the page where you see the shortcodes and I can simply add the WP Engine shortcode and it will work by hiding entire row elements built from Visual Composer’s shortcodes.

In Cornerstone, is there a way to view the page with just the raw shortcodes so I can add mine? I tried to edit the page in Wordpress but I see the warning that editing the page subsequently in Cornerstone will strip out all the new information that I added while editing in Wordpress.

Any insight into this would be much appreciated!

Hi Jon-Sun,

Thank you for reaching out to us. In Cornerstone, you can paste your shortcode in Classic Raw Content element. Simply drag and drop the Classic Raw Content element in your content. Inside the Content text area, paste your shortcode (see screenshots)

Hope this helps!

HI Nabeel,

Hm that definitely works for small div containers or small copy, but what if I wanted to hide/show an entire row element? For example in Cornerstone there are rows that have child elements under them, i’d want to hide the entire row element along with the child elements.

See screenshot below, i’d like to hide that entire row depending on where the visitor is from

Hi Jon-Sun,

Regretfully that is a limitation on the Content builder, the Section, Row, and Column has ID and CLASS field though, maybe there is a way of using that with WP Engine GeoTarget to target the specific Section/Row.

Or try wrapping your Row content with the opening tag [geoip-content region="NY"] at the top of the ROW, and the closing tag at the bottom [/geoip-content] at the bottom. Use the Content Area element or RAW content element.

Thanks,

Hi Friech,

Ah that’s unfortunate, I might try that and i’ll look at some alternative solutions with javascript.

Thanks for the assistance!

Best,

You’re always welcome Jon-Sun!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.