-
AuthorPosts
-
December 15, 2018 at 10:33 pm #1045740
Hi there I would like to remove the html markup (span tag) that automatically gets wrapped around the ampersand character.
I found a number of posts detailing how to remove the styling but I need to remove the actual markup and I am using it in a jquery script for links but the additional code is causing problems.
December 16, 2018 at 5:40 am #1045790Hey jacqueschoquette,
Please look in \wp-content\themes\enfold\functions-enfold.php
lines: 582-583
You could remove the lines or edit to suit.Best regards,
MikeDecember 16, 2018 at 10:03 am #1045849just a moment – sorry i first misunderstood your request.
May I ask why the tags bother you when they have no effect on your appearance?if you like to get rid of the whole special treatment you
can test this on child-theme functions.php:if(!function_exists('avia_ampersand')){ function avia_ampersand($content){ // } }
or if you only like to get rid of extra treatment for ampersand leave the quotes style in it
if(!function_exists('avia_ampersand')) { add_filter('avia_ampersand','avia_ampersand'); function avia_ampersand($content) { // quotes $content = str_replace("“","<span class='special_amp'>“</span>",$content); // left double quotation mark “ $content = str_replace("”","<span class='special_amp'>”</span>",$content); // right double quotation mark ” $content = str_replace("„","<span class='special_amp'>„</span>",$content); // double low-9 quotation mark „ $content = str_replace("“","<span class='special_amp'>“</span>",$content); // left double quotation mark “ $content = str_replace("”","<span class='special_amp'>”</span>",$content); // right double quotation mark ” $content = str_replace("„","<span class='special_amp'>„</span>",$content); // double low-9 quotation mark „ return $content; } }
by the way : every function introduced on wordpress via if(!function_exists
can be handled this way of substitution in child-themes functions.php- This reply was modified 5 years, 11 months ago by Guenni007.
December 16, 2018 at 10:23 am #1045854and again btw: – the newly introduced filter : avia-ampersand can be misused to have some other content substitutions.
F.e. to replace all hyphens to non-breaking hyphens etc. pp.add_filter('avia_ampersand','non_breaking_hyphens'); function non_breaking_hyphens($content) { $content = str_replace("-","‑",$content); return $content; }
sorry Boardsoft directly changes the code even in code block:
December 16, 2018 at 4:05 pm #1045935Hi,
@Guenni007 great tips, thanks.Best regards,
MikeDecember 17, 2018 at 3:49 am #1046127Thank you #1045849 did the trick for me.
December 17, 2018 at 6:25 am #1046177 -
AuthorPosts
- You must be logged in to reply to this topic.