Hi guys,
I have a site, https://hilltopmontessori.com, which has upwards of 30 pages using a breadcrumbs shortcode that was working fine until a recent update. Now we are getting some strange behavior I hope you can help with.
First of all, I put the following code in my child theme’s functions.php:
add_shortcode(‘breadcrumbs’, ‘x_breadcrumbs_display’);
function x_breadcrumbs_display ($atts) {
ob_start();
x_breadcrumbs();
return ob_get_clean();
}
It works just fine when the pages are rendered. The breadcrumbs show up nicely. The problem comes when I try to edit a page. If I go to Pages, then click the main page title from a list of pages, I get the following error:
Fatal error: Uncaught Error: Call to undefined function x_breadcrumbs() in /home/hilltop8/public_html/wp-content/themes/x-child/functions.php:57 Stack trace: #0 /home/hilltop8/public_html/wp-includes/shortcodes.php(319): x_breadcrumbs_display('', '', 'breadcrumbs') #1 [internal function]: do_shortcode_tag(Array) #2 /home/hilltop8/public_html/wp-includes/shortcodes.php(197): preg_replace_callback('/\\[(\\[?)(breadc...', 'do_shortcode_ta...', '<p>[breadcrumbs...') #3 /home/hilltop8/public_html/wp-content/plugins/cornerstone/includes/elements/classic/text/shortcode.php(15): do_shortcode('<p>[breadcrumbs...') #4 /home/hilltop8/public_html/wp-content/plugins/cornerstone/includes/classes/classic/elements/class-element-wrapper.php(158): include('/home/hilltop8/...') #5 /home/hilltop8/public_html/wp-includes/shortcodes.php(319): Cornerstone_Element_Wrapper->shortcode_output('class="x-text" ', '[breadcrumbs]', 'cs_text') #6 [internal function]: do_shortcode_tag(Array) #7 /home/hilltop8/public_html/wp-includes/shortcodes.php(197): in /home/hilltop8/public_html/wp-content/themes/x-child/functions.php on line 57
If I hover over the page name and click Edit in Cornerstone, I am able to edit the page just fine. However, when I exit Cornerstone, I get the same Fatal Error as above.
Additionally, when editing the page in Cornerstone, the block or code that should display the [breadcrumbs] shortcode is invisible. No matter how I try to hover or click in that area, I cannot locate it. Can you advise here if there is a way to see it?
Because of the volume of pages, I don’t want to have to go and edit each one to use the newer Breadcrumbs element if I can avoid it.
Thanks so much,
Cindy