Home Forums Consulting – Business WordPress Theme Header Information field stripping out code

Tagged: , ,

This topic contains 8 replies, has 3 voices, and was last updated by  Baxter 1 year, 3 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1506

    Chris
    Member

    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.

    #1512

    Baxter
    Keymaster

    Hi,

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

    Regards

    #1533

    Chris
    Member

    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

    Patrick
    Member

    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!

    #1944

    Baxter
    Keymaster

    Hi,

    Please try to customize 152-173rd lines.

    Regards

    #2034

    Chris
    Member

    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.

    #2037

    Baxter
    Keymaster

    Thank you))

    #2272

    Patrick
    Member

    I tried this but it doesn’t work.

    #2273

    Baxter
    Keymaster

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

    Regards

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.