Mobile app version of vmapp.org
Login or Join
Debbie626

: Wordpress description problem in tab I have a website on WordPress. Theme name which I use is hueman. There are title and description on tab when homepage is open. But when I configured meta

@Debbie626

Posted in: #Wordpress

I have a website on WordPress. Theme name which I use is hueman. There are title and description on tab when homepage is open. But when I configured meta tags and started to use w3 total cache there are only title. And this title probably doesn't come from Wordpress general settings.
My meta tags:

<meta name="description" content="xxxxxxxxxxx"/>
<meta name="keywords" content="xxx, xxx, xxx, xxx"/>
<meta name="abstract" content="xxx" />
<meta name="copyright" content="&copy; xxx" />
<meta name="robots" content="index, follow" />
<meta name="author" content="xxx"/>


I've used:

<title><?php bloginfo('name'); ?> |<?php bloginfo('description'); ?></title>


But it doesn't work. How do I fix this problem? By the way there are no title tag in header.php

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Debbie626

1 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi995

Ditch Meta Keywords...

Meta keywords are useless and not worth spending any time on whatsoever because the vast amount of search engines ignore them.

You won't find the title because...

Without going too much into the WordPress development sides of things, the reason you're not seeing <title> within the file header.php is because most wise theme developers call it in the wp_head() which can normally be found within the <head> in the file header.php.

Where you can find WP_Title

If you look in /wp-content/themes/hueman/functions/class-utils.php you will find it has:

add_action( 'wp_head', array( $this , 'hu_wp_filters') );

Which means it has a array of actions under the filter name hu_wp_filters, scrolling down you will find this filter:

function hu_wp_filters() {
if (apply_filters('hu_img_smart_load_enabled', ! hu_is_ajax() && hu_is_checked('smart_load_img'))) {
add_filter('the_content', array( $this,'hu_parse_imgs'), PHP_INT_MAX);
add_filter('hu_post_thumbnail_html', array($this,'hu_parse_imgs'));
}
add_filter('wp_title', array( $this,'hu_wp_title'), 10, 2 );
}


Looking at the above code you can see it's calling for wp_title but then, to make things a little bit more confusing, it's applying a filter rule called hu_wp_title, scrolling down further you will come across this filter and ultimately this is the code that is driving your titles and should be no reason to manually use <title> in the head.

function hu_wp_title($title, $sep) {
if (function_exists('_wp_render_title_tag'))
return $title;
global $paged, $page;
if (is_feed())
return $title;
$title .= get_bloginfo('name');
$site_description = get_bloginfo( 'description' , 'display' );
if ($site_description && hu_is_home())
$title = "$title $sep $site_description";
if ($paged >= 2 || $page >= 2)
$title = "$title $sep " . sprintf( __( 'Page %s' , 'hueman' ), max( $paged, $page ) );
return $title;
}


Unless of course you want to make changes that are not supported within the current filter. Since there is no meta description in either the header.php or wp_head(); you can add it manually to the header.php like so:


<meta name="description" content="<?php bloginfo('description'); ?>" />


If your still having issues then I recommend that you use Yoast SEO which will handle your titles and meta descriptions for you without having to dive too much into the code. If you have any development related questions then you will need to ask on the WordPress Development stack.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme