WP: Theme Support For Title

So far we’ve developed a theme that can load blog posts on the front page and allows us to open each post/article on it’s own independent perma(nent)-link.

But there’s one problem! We see the title of the page as a link as follows:

This can easily be fixed by adding theme support for title-tag using the add_theme_support WordPress function.

This function can be triggered on the action hook after_setup_theme as follows:

function ob_theme_features() {
	add_theme_support('title-tag');
}
add_action('after_setup_theme', 'ob_theme_features' );

Where does this code go? You must’ve guessed this already but if you’re new, it goes in functions.php file of our newly developed theme.

The result? We see a title instead of a link as follows:

Next, we’ll have a look at loading the WordPress admin bar in our theme.

Leave a comment