Jump to content
Babaman

How to Generate Perfect WordPress Title Tags

Recommended Posts

Hello guys,

I read this guide for a more seo friendly title, very interesting https://perishablepress.com/how-to-generate-perfect-wordpress-title-tags-without-a-plugin/

I need to add custom Keyword to the tag <title>, like "streaming hd" after the movie title or TV series.

I saw that it can be done from the Dbmovies panel -> settings -> tab title, but it is published on the page, it's not what I want.

Help for this could be useful to many people

example:

<title>
<?php if (is_home()) { bloginfo('name'); echo ' | en Streaming' ;}
elseif (is_category()) {
single_cat_title(); echo ' en Streaming | ' ; bloginfo('name');}
elseif (is_single()) {
single_post_title();
echo ' ('; $category = get_the_category(); $parent = get_cat_name($category[0]->category_parent);
if (!empty($parent)) {echo ''. $parent; } else { echo ''. $category[0]->cat_name; }echo')'; 
$terms_as_text = strip_tags( get_the_term_list( $wp_query->post->ID, 'anno', '(', ', ', ')' ) ); 
echo $terms_as_text; echo ' in Streaming e Download Cacaoweb|Nowvideo';}//echo get_post_meta($post->ID, "subtitle", true);
elseif (is_page()) {
bloginfo('name'); echo ' | '; single_post_title();}
elseif (is_author()) {
echo 'User '; wp_title(); echo ' | '; bloginfo('name');}
elseif (is_tax('cast')) {
echo 'Filmografia '; $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); echo $term->name; echo ' in Streaming | '; bloginfo('name');}
elseif (is_tax('director')) {
echo 'Filmografia '; $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); echo $term->name; echo ' in Streaming | '; bloginfo('name');}
elseif (is_tax('year')) {
echo 'Film del '; $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); echo $term->name; echo ' in Streaming | '; bloginfo('name');}
else {wp_title('',true);} ?>
</title>

Thanks

 

 

Edited by Babaman

Share this post


Link to post
Share on other sites

×
×
  • Create New...