Component is not Showing Above Footer After Changing Component ID in the functions.php File

Hi, I’ve been using a script in the functions.php file for fixheadphones.co.uk to display a component as the footer on every page. It has been working fine. I created a new footer as a component and replaced the existing component ID for the new one in the functions.php file, but now nothing is showing. When I put the previous component ID back in, it shows. I don’t know why the footer isn’t showing after putting in the new component ID.

I hope you can help!

I’ll add the details in a secure note.

Thanks!

Hey @core365,

Please note that custom coding is outside the scope of our support. I will provide some suggestions but if they don’t solve the issue, you can sign up to our One service.

Below are two possible reasons why your new Cornerstone footer component is not displaying.

Cause 1: The “Export Component” Option is Turned Off (Most Likely)

In Cornerstone, components are not automatically available to be rendered via shortcodes unless they have been explicitly marked for export. When this is disabled, the theme’s shortcode handler will not find the component in its registry cache, and will render nothing (an empty string).

How to Fix:

  1. Open the Cornerstone Builder and navigate to your Components section.
  2. Open the “Footer” component (ID: hJlgIXtPtPlD0EJbho).
  3. Right-click the element/component in the inspector or click its settings to open the element manager.
  4. Locate the “Export Component” toggle/checkbox and turn it ON.
  5. Save the component. This will register the component in the system and automatically purge the component cache.
  6. Verify that the generated shortcode matches the ID you copy-pasted.

Cause 2: Smart/Curly Quotes in Your Code Snippet

The code snippet you provided contains curly quotes (e.g., , , , ) instead of straight/standard quotes (e.g., ', ").

  • PHP Syntax Error: If curly quotes are used as PHP string delimiters (such as ‘x_before_view_footer_base’), it will trigger a fatal PHP syntax error and potentially crash the site.

  • WordPress Shortcode Parsing Failure: If you are using standard quotes in PHP but curly quotes inside the shortcode itself (id=“hJlgIXtPtPlD0EJbho”), WordPress’s shortcode parser (do_shortcode) will fail to recognize the id attribute. When the Cornerstone shortcode handler receives an empty ID, it silently returns an empty string without throwing an error, resulting in a blank footer.

How to Fix:

Ensure that your snippet in functions.php uses only standard straight quotes. Replace your code snippet with the corrected version below:

https://gist.githubusercontent.com/christian-ynion/961c0696bc100b05a9fb6329f4779b5c/raw/ab51b0bf448f799fe73e19623221e7cc0a057281/gistfile1.txt

Hi @christian,

Many thanks for your help and the various fixes supplied! As you suspected, it was “Cause 1: The “Export Component” Option is Turned Off (Most Likely)”. I didn’t realise the export component had to be enabled for that function to work.

It’s all working fine now!

Thanks for your time and help, it’s much appreciated!

Thanks!