-
AuthorPosts
-
December 13, 2020 at 8:02 pm #1266928
Hi, in need to changes toggle headers from p to h3. Please, I need the code to insert in functions.php in the child theme.
Thanks.December 13, 2020 at 9:09 pm #1266941i realy think that the best and propper way would be to have a child-theme toggles.php file
you find the original file in your enfold folder: /config-templatebuilder/avia-shortcodes/toggles/on line 917 ( Enfold newest Version) there is :
$output .= ' <p data-fake-id="#' . $toggle_atts['custom_id'] …
and the closing tag is on line 918
$output .= ' <span class="vert_icon"></span><span class="hor_icon"></span></span></p>';
instead of those two p insert your h3
see here the edited file: https://pastebin.com/fREzmbUb
or download it from my pastebin : Linkput that edited ALB Element to your child-theme/shortcodes folder
this folder is not per se in your child-themes folder – create it thenand put this ( if it is not allready done) to your child-theme functions.php :
you find this snippet on documentation : https://kriesi.at/documentation/enfold/intro-to-layout-builder/#customizationfunction avia_include_shortcode_template($paths){ $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; } add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
- This reply was modified 3 years, 11 months ago by Guenni007.
December 13, 2020 at 9:13 pm #1266942There is probably also a jQuery solution without the need to deposit a child theme version of toggles.php file .
However, some of the contributors here are of the opinion that bots such as the Google Bot would probably read over these jQuery replacements and still SEO wise lead the as p-tag.you can test this first in your child-theme functions.php:
function replace_tags_with_tags(){ ?> <script> (function($) { function replaceElementTag(targetSelector, newTagString) { $(targetSelector).each(function(){ var newElem = $(newTagString, {html: $(this).html()}); $.each(this.attributes, function() { newElem.attr(this.name, this.value); }); $(this).replaceWith(newElem); }); } replaceElementTag('.togglecontainer p.toggler', '<h3></h3>'); }(jQuery)); </script> <?php } add_action('wp_footer', 'replace_tags_with_tags');
December 14, 2020 at 2:20 pm #1267145December 16, 2020 at 9:08 pm #1267945i guess you had to help her – she ( or he – could be both with that nick) – only 2 postings on her history. Maybe that is hard stuff for a beginner
-
AuthorPosts
- You must be logged in to reply to this topic.