Header Information field stripping out code

Started by: Chris April 21, 2016 - 04:48

Hello,

First off, I would like to say thank you for such a great looking theme.

I'm having trouble with the Header Information field, it seems to be stripping out link tags. I am trying to put in links for the email address(mailto:) and phone(tel:) but it removes on the front end.

Please let me know if there is a simple fix or a way to get around it.

Thanks

Chris.



Replies:

  • Author Team
    #1512 Reply

    Baxter
    Hi,

    It needs to change Header information section URLs in header.php file.

    Regards

    #1533 Reply

    Chris
    Thank you Baxter, You have pointed me in the right direction.

    For anyone else having this issue. in the header.php file, there is a Wordpress function wp_kses which was stripping the anchor tag which needs to be updated to allow it.

    #1939 Reply

    Patrick
    Hello,

    I am having the same problem. I am using header 4 and tried to do this -> doesn’t work. Could you help me on wich line i have to edit what?

    Thanks!

    Author Team
    #1944 Reply

    Baxter
    Hi,

    Please try to customize 152-173rd lines.

    Regards

    #2034 Reply

    Chris
    Hello Patrick,

    I noticed the line number changes from version to version, here's an example of what you need to do.

    Open up header.php and look for:

    <div class="text"><?php echo wp_kses( nl2br( $header_phone ), array( 'br' => array(), 'strong' => array(), 'span' => array('data-scroll-to' => array()) ) ); ?></div>

    Update the line to:

    <div class="text"><?php echo wp_kses( nl2br( $header_phone ), array( 'a' => array('href' => array()), 'br' => array(), 'strong' => array(), 'span' => array() ) ); ?></div>

    Saved the updated header.php file in the child theme's directory.

    The example shown above is for $header_phone, but you will also need to do this for $header_hours and $header_address too if you want to allow links in those fields too.

    Hope that helps.

    Author Team
    #2037 Reply

    Baxter
    Thank you))
    #2272 Reply

    Patrick
    I tried this but it doesn't work.
    Author Team
    #2273 Reply

    Baxter
    In this case please try to remove wp_kses() function at all.

    Regards

You must be logged in to reply to this topic.