Tagged: error, functions.php, magazine element
-
AuthorPosts
-
August 31, 2018 at 11:39 am #1004031
HI my site was down after I did a restore to a backup this morning. It got corrupted last night after I was trying out some code in the child theme
I was seeing this:`Notice: Undefined variable: post in /www/wp-content/themes/enfold-child/functions.php on line 106 Notice: Trying to get property of non-object in /www/wp-content/themes/enfold-child/functions.php on line 106 Notice: Undefined variable: post in /www/wp-content/themes/enfold-child/functions.php on line 107 Notice: Trying to get property of non-object in /www/wp-content/themes/enfold-child/functions.php on line 107 Notice: Undefined variable: display_child_pages in /www/wp-content/themes/enfold-child/functions.php on line 108 Notice: Undefined variable: sidebar_menu in /www/wp-content/themes/enfold-child/functions.php on line 108 Notice: Undefined variable: children in /www/wp-content/themes/enfold-child/functions.php on line 110 Notice: The called constructor method for WP_Widget in WPAC_Nav_Menu_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /www/wp-includes/functions.php on line 3916Fatal error: Cannot redeclare av_countdown_events_fallback() (previously declared in /www/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/events_countdown/events_countdown.php:16) in /www/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/events_countdown.php on line 8
`
If I read that right, the error is in the child theme functions.php, correct?
I see the code error is here in the file:/*==========MAGAZINE ELEMENT add excerpt under title al l===========*/ add_filter('avf_portfolio_cpt_args', 'avf_portfolio_add_custom_fields', 1); function avf_portfolio_add_custom_fields($args) { $args['supports'] = array('title','thumbnail','excerpt','editor','comments', 'custom-fields', 'page-attributes'); return $args; } $default_sidebar = false; $parent = get_the_title($post->post_parent); $parentlink = get_the_permalink($post->post_parent); $sidebar_menu .= "<nav class='widget widget_nav_menu $display_child_pages'><ul class='nested_nav'>"; $sidebar_menu .= "<h3 class='widgettitle'><a href='{$parentlink}'>$parent</a></h3>"; $sidebar_menu .= $children; $sidebar_menu .= "</ul></nav>"; add_filter('widget_text', 'do_shortcode');
I’m not sure I need that code anymore since I think I edited the magazine.php which I have in my child theme to show the excerpts instead with this code that you gave me:
if(empty($this->atts['thumbnails'])) { $image = ""; $extraClass = "av-magazine-no-thumb"; } } $excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters( 'avf_magazine_excerpt_length' , 60) , apply_filters( 'avf_magazine_excerpt_delimiter' , " "), "…", true, '');.
Also I have commented out the code and the excerpt are still showing fine (see page below). Not sure what to do there, if anything
I reinstalled the theme and that seems to have fixed the error with the events-countdown.php file that was giving me that FATAL ERROR. When the debug was still on (it’s off now) I was getting these notices:
Notice: Undefined index: index in /www/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_gallery/masonry_gallery.php on line 468 Notice: Undefined index: index in /www/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_gallery/masonry_gallery.php on line 471 Notice: Undefined index: index in /www/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_gallery/masonry_gallery.php on line 472
Notice: Undefined index: index in /www/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/buttons_fullwidth/buttons_fullwidth.php on line 421
Should I do something about that those things? The site seems to be displaying OK now.
thanks for your helpNancy
- This topic was modified 6 years, 3 months ago by Munford.
August 31, 2018 at 3:55 pm #1004138Hey Munford,
Which version of php are you running?
You might want to reupdate Enfold but via FTP this time.
Credentials did not work for me.
Best regards,
VictoriaAugust 31, 2018 at 9:56 pm #1004222HI Victoria
I should be running phh 7.1
I think I have worked out most of the bugs on the site now.
These notices appeared after I updated Enfold via ftp. I’m not sure if I need to pay attention to them or not:Notice: Undefined index: index in /www/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_gallery/masonry_gallery.php on line 468 Notice: Undefined index: index in /www/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_gallery/masonry_gallery.php on line 471 Notice: Undefined index: index in /www/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_gallery/masonry_gallery.php on line 472
Notice: Undefined index: index in /www/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/buttons_fullwidth/buttons_fullwidth.php on line 421
thanks
NancySeptember 3, 2018 at 7:37 am #1004799Hi,
Thanks for the update.
They are not critical errors so you can just ignore them — set the WP_DEBUG to false or disable it. You can also set the builder to debug mode and then run the shortcode parser’s repair function.
// https://kriesi.at/documentation/enfold/intro-to-advanced-layout-builder/#debug-mode
Best regards,
IsmaelSeptember 3, 2018 at 10:36 am #1004838thanks you can close this thread
-
AuthorPosts
- You must be logged in to reply to this topic.