Tagged: custom code, enfold
-
AuthorPosts
-
February 20, 2017 at 11:30 am #749269
Hi I have a question. My website online has the enfold version 3.8
in order to work on some custom pages and do some tests I downloaded my website on my local pc. In the meanwhile I updated the theme (locally only) to enfold 3.8.5I realized that if I keep my custom shortcode in the child theme it gives problems in adding new pages: whenever I update a new page or I try to delete it, a completely blank screen appears, although it actually saves or bin the pages (i.e. the action is completed successfully). Trying to understand what was messing up, I realized that everything worked fine if I deleted the shortcode folder in my child theme.
At this point, before updating the online enfold theme I would like to understand if you are aware of such bugs. The shoertcode I created was very simple, as it only applied the <abbr> tag to the text. herebelow I copy my code:
if ( !class_exists( 'av_abbr' ) ) { class av_abbr extends aviaShortcodeTemplate { /** * Create the config array for the shortcode button */ function shortcode_insert_button() { $this->config['name'] = __('Acronym Extension'); $this->config['order'] = 100; $this->config['shortcode'] = 'av_abbr'; $this->config['tooltip'] = __('Creates a full text which appears on mouse over acronyms terms'); $this->config['inline'] = true; $this->config['tinyMCE'] = array('tiny_always'=>true); } /** * Popup Elements * * If this function is defined in a child class the element automatically gets an edit button, that, when pressed * opens a modal window that allows to edit the element properties * * @return void */ function popup_elements() { $this->elements = array( array( "type" => "tab_container", 'nodescription' => true ), array( "type" => "tab", "name" => __("Content" , 'avia_framework'), 'nodescription' => true ), array( "name" => __("Acronym", 'avia_framework' ), "desc" => __("This is the acronym.", 'avia_framework' ), "id" => "acronym", "type" => "input", "std" => __("ACR", 'avia_framework' )), array( "name" => __("Full title", 'avia_framework' ), "desc" => __("This is the text that appears on your acronym.", 'avia_framework' ), "id" => "title", "type" => "input", "std" => __("Full text", 'avia_framework' )), array( "type" => "close_div", 'nodescription' => true ), ); } /** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $output = ""; $atts = shortcode_atts( array( 'title'=>'', 'acronym' =>'', ), $atts, $this->config['shortcode']); $output = ''; $output= "<abbr title='".$atts['title']. "'> " . $atts['acronym'] . "</abbr>"; //<abbr title = 'xx'>ACR</abbr> return $output; } } }
Thanks very much
February 24, 2017 at 12:29 am #751126Hey Elena,
Try to follow the instructions here instead: http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/
Best regards,
NikkoMarch 2, 2017 at 11:18 am #754275Yes Nikko, I did already add teh code you mention to my functions.php file. However I have the suspect that an issue exist with the local copy I am working with and not with the Enfold update. I will try today to update Enfold on the online version of the website and see what happens. In case I have the same issue I’ll contact you again and give an access to the website.
thanksMarch 4, 2017 at 5:11 am #755462 -
AuthorPosts
- You must be logged in to reply to this topic.