Global Variables Defined In Functions.php For Use In Cornerstone Header, Footer, etc Attribute Text Areas

Hello,

Is there a specific and simple way to add custom variables to functions.php and then use them within Cornerstone?

For example, all buttons I create in cornerstone have a specific link. I use the buttons in various shapes and sizes, but would prefer to have a global variable to enter into the URL text area of the button configuration.

Is this possible within functions.php and X Theme?

As a side note, I have other defined global variables that will work on Pages and Posts, but they are not working on attributes for buttons and other Cornerstone objects.

Thank you in advance for your kind advice.

Hi @nonprofitdev,

Thank you for reaching out to us. Currently there is no option to add custom variables that can be used within Cornerstone/Content builder however we have a feature called Dynamic Content that could do what you’re looking for, I’d recommend you to take a look at it’s documentation here https://theme.co/docs/work-with-dynamic-content

Hope this helps!

Hi Nabeel,
Thank you for your suggestion, this seems more on the right track but do you know if I can add custom Dynamic Content text snippets in functions.php and the source code to do this?

Basically I need to add custom reusable text snippets but I’m not seeing I can add custom global data in a clean way.

Please let me know.

Sincerely thank you for your advice.

Hi @nonprofitdev,

I advise you to create a custom shortcode in order for you to have a resuable text snippets. Regretfully, providing custom code is outside the scope of our theme support. You may seek 3rd party developers to help you with your problems or you can avail One where we can answer questions outside of the features of our theme.

Hope that helps and thanks for understanding.

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