Tagged: breadcrumbs, enfold, Php error
-
AuthorPosts
-
December 15, 2021 at 11:43 am #1332930
Hi Guys,
I am working with a customer who is using the following code in functions.php to modify breadcrumb output:
//advanced title + breadcrumb function if (!function_exists('avia_title')) { function avia_title($args = false, $id = false) { global $avia_config; if (!$id) $id = avia_get_the_id(); $header_settings = avia_header_setting(); if ($header_settings['header_title_bar'] == 'hidden_title_bar') return ""; $defaults = array( 'title' => get_the_title($id), 'subtitle' => "", //avia_post_meta($id, 'subtitle'), 'link' => get_permalink($id), 'html' => "<div class='{class} title_container'><div class='container'>{heading_html}</div></div>{additions}", 'heading_html' => "<h1 class='main-title entry-title'>{title}</h1>", 'class' => 'stretch_full container_wrap alternate_color ' . avia_is_dark_bg('alternate_color', true), 'breadcrumb' => true, 'additions' => "", 'heading' => 'h1' //headings are set based on this article: http://yoast.com/blog-headings-structure/ ); if (is_tax() || is_category() || is_tag()) { global $wp_query; $term = $wp_query->get_queried_object(); $defaults['link'] = get_term_link($term); } else if (is_archive()) { $defaults['link'] = ""; } // Parse incomming $args into an array and merge it with $defaults $args = wp_parse_args($args, $defaults); $args = apply_filters('avf_title_args', $args, $id); //disable breadcrumb if requested if ($header_settings['header_title_bar'] == 'title_bar') $args['breadcrumb'] = false; //disable title if requested if ($header_settings['header_title_bar'] == 'breadcrumbs_only') $args['title'] = ''; // OPTIONAL: Declare each item in $args as its own variable i.e. $type, $before. extract($args, EXTR_SKIP); if (empty($title)) $class .= " empty_title "; $markup = avia_markup_helper(array('context' => 'avia_title', 'echo' => false)); if (!empty($link) && !empty($title)) $title = $title; if (!empty($subtitle)) $additions .= "<div class='title_meta meta-color'>" . wpautop($subtitle) . "</div>"; if ($breadcrumb) $additions .= avia_breadcrumbs(array('separator' => '>', 'richsnippet' => true)); if (!$title) $heading_html = ""; $html = str_replace('{heading_html}', $heading_html, $html); $html = str_replace('{class}', $class, $html); $html = str_replace('{title}', $title, $html); $html = str_replace('{additions}', $additions, $html); $html = str_replace('{heading}', $heading, $html); if (!empty($avia_config['slide_output']) && !avia_is_dynamic_template($id) && !avia_is_overview()) { $avia_config['small_title'] = $title; } else { return $html; } } }
Since updating to Enfold 4.8.8 the following line is causing a fatal error.
46 PHP Fatal error: Uncaught Error: Call to undefined function avia_breadcrumbs() in /nas/content/live/gagemathersstg/wp-content/themes/enfold-child/functions.php:85\nStac
The line that is causing the problem is extracted below.
if ($breadcrumb) $additions .= avia_breadcrumbs(array('separator' => '>', 'richsnippet' => true));
If I remove the line the site is visible but breadcrumbs are no longer visible on any of the pages.
Has avia_breadcrumbs been depreciated or changed in 4.8.8 or have there been any other changes to the breadcrumbs that we should know about to make them work again?
I have rolled back the server to 4.7.1 for now just while I raise this issue so the client can still access the site.
December 15, 2021 at 12:42 pm #1332937Hi thinkjarvis,
Please try to replace this code:
if ($breadcrumb) $additions .= avia_breadcrumbs(array('separator' => '>', 'richsnippet' => true));
with:
if ($breadcrumb) $additions .= Avia_Breadcrumb_Trail()->get_trail( array( 'separator' => '/', 'richsnippet' => true ) );
the avia_breadcrumbs function has already been deprecated.
Best regards,
NikkoDecember 15, 2021 at 1:54 pm #1332954Hi Nikko,
You Legend. Thank you.
I have updated the site to 4.8.8 successfully with the modification in place.
Please leave this issue open for now. I am waiting for the client to QA the updates.
-
AuthorPosts
- You must be logged in to reply to this topic.