Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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.

    #1045790

    Hey 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,
    Mike

    #1045849

    just 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 6 years ago by Guenni007.
    #1045854

    and 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:

    #1045935

    Hi,

    @Guenni007
    great tips, thanks.

    Best regards,
    Mike

    #1046127

    Thank you #1045849 did the trick for me.

    #1046177

    Hi jacqueschoquette,

    Great, glad you got it working and thanks for the feedback. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.