Add HTML Tags in Post and Widget Titles


In a recent project, I needed to use <span /> tags to add some styles (just color, actually) to post and widget titles. By default — and there’s no hook to disable this — WordPress strips any HTML tags found in post and widget titles. Here’s my solution to this problem. Please keep in mind that I only needed to add <span /> tags, so if you need to add more tags, you should modify the code to fit your needs :) Continue reading

Reminder: add_action


Just a quick reminder, when dynamically adding an action inside an action callback for the same hook, don’t forget to use lower priority for the action you just added.

add_action( 'init', 'my_fuction' );
function my_fuction( $args ) {
    // ...
    add_action( 'init', 'my_other_function', 11 );