How to remove page title from wp head on specific page?

Question

I’m trying to remove page title from a template. Actually I’m using custom in title for singledigital.php template, and wp_head also adding page title on this page. So i want to remove it. I have tried following trick.

I added an action for singledigital.php in my child theme’s function.php

function remove_page_title(){
    remove_action('wp_head', 'theme_slug_render_title');
}
add_action( 'singledigital.php', 'remove_page_title' );

Then added this do_action( 'singledigital.php' ); in singledigital.php. But this does not working. Can anyone guide me how can i do this kind of task. I would like to appreciate if someone guide me. Thank You.

As Requested in the comments I added header.php Code

<?php 
    $cpCatTitleR = get_query_var('cat_slug');
    $catPageObj = get_category_by_slug($cpCatTitleR); 
    $catPageID = $catPageObj->term_id;
    $catPage_option = get_option('taxonomy_'.$catPageID);
    $catPage_option['category_meta_page_title']; 

    if(!empty($cpCatTitleR) && !empty($catPage_option['category_meta_page_title']) ){?>
        <title><?php echo $catPage_option['category_meta_page_title']; ?> </title>
        <meta name="description" content="<?php echo $catPage_option['category_meta_page_description']; ?>"/>
    <?php }
0
, , Ayaz Shah 7 years 2016-08-07T06:59:43-05:00 0 Answers 72 views 0

Leave an answer

Browse
Browse