Hello there, my first post here hello everybody, i need help regarding a footer.php in wordpress. The theme i use do not allow a link mark-up on a text in the footer area i think the snippet is this: $custom_text_html = ''; $custom_text = boldthemes_get_option( 'custom_text' ); if ( $custom_text != '' ) { $custom_text_html = '<p class="copyLine">' . $custom_text . '</p>'; can someon can help me to change it to achieve what i need? Ty Alex
The theme footer code that you have shared doesn't have any code that removes the HTML code from. custom_text can contain HTML as far as the above code is concerned.
But the <a href> markup doesn't work it still show only text not linkable i've found this comment about in a theme develope site: The thing with the custom footer text on header & footer panel is that all text within customize panels have to be sanitized prior to output on front end for the reasons of security. On the other hand, if you take a look at the lines 23-26 of the footer.php file in your theme’s folder you will notice the following: $custom_text = boldthemes_get_option( 'custom_text' ); if ( $custom_text != '' ) { $custom_text_html = '<p class="copyLine">' . $custom_text . '</p>'; } You can change this so the $custom_text_html gets the markup you want.
I've done, i've changed the p whit a tag '<a href="url">' . $custom_text . '</a>'; instead of '<p class="copyLine">' . $custom_text . '</p>' it works, thank you anyway
That is good as long as it works. Also you can change boldthemes_get_option to get_option official WP function and the HTML won't be removed. Even if it is removed then it has to be via some filter
Change $custom_text = boldthemes_get_option( 'custom_text' ); to $custom_text = get_option( 'custom_text' );