How to add a <title> element to a specific page on WordPress?

115 Views Asked by At

I'd like to add a title element to a specific page (not all pages). I am using Yoast but I could not find this page on Yoast plugin. So I think I'd have to add it on PHP file head section. But my head section is like this below, how can I add it?

<?php
/**
 * The template for displaying all single jobs.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 * @package WorkSt
 */

get_header(); ?> 

Then below this is HTML, e.g. container and so on.

1

There are 1 best solutions below

0
On

You can to this by wp_head hook of wordpress

add_action('wp_head', 'add_custom_meta');

function add_custom_meta(){
    global $post;
    if( 'your-page-slug' === $post->post_name ){    
        echo '<meta content="your content">'; // add mete here
    }
}