Hi I am very new to wordpress I hope many of us here use or have used wordpress. I recently setup a blog on wp and installed a plug-in called Page Meta to add Meta Tags (title description and keywords to every page) There is one very confusing instruction on #3 that I am not able to follow. I need help with it. I posted in WP forums but have not received any reply yet. I hope here I will surly get some help. Here is the link to the post that I have made in WP forum and link to plug-in page WP forum post Plug-in I just need help understating the php code and few instructions on how to edit php template and customized it according to my needs.
You need to change wp_title() to <?php if (function_exists('meta_title')) { meta_title(); } else { wp_title(); } ?> you can find it in header between title tag (<title>PASTE HERE</title>)
Here is the code between my <title></title> tag title><?php if (is_home()) { echo bloginfo('name'); } elseif (is_404()) { echo '404 Not Found'; } elseif (is_category()) { echo 'Category:'; wp_title(''); } elseif (is_search()) { echo 'Search Results'; } elseif ( is_day() || is_month() || is_year() ) { echo 'Archives:'; wp_title(''); } else { echo bloginfo('name'); echo wp_title(''); } ?></title> PHP: According to the instructions it should be this: title><?php if (is_home()) { echo bloginfo('name'); } elseif (is_404()) { echo '404 Not Found'; } elseif (is_category()) { echo 'Category:'; if (function_exists('meta_title')) { meta_title(); } else { wp_title(); } } elseif (is_search()) { echo 'Search Results'; } elseif ( is_day() || is_month() || is_year() ) { echo 'Archives:'; if (function_exists('meta_title')) { meta_title(); } else { wp_title(); } } else { echo bloginfo('name'); echo if (function_exists('meta_title')) { meta_title(); } else { wp_title(); } } ?></title> PHP: If I am doing right it shows only a blank page
here is <title><?php if (is_home()) { echo bloginfo('name'); } elseif (is_404()) { echo '404 Not Found'; } elseif (is_category()) { echo 'Category:'; if (function_exists('meta_title')) { meta_title(); } else { wp_title();} } elseif (is_search()) { echo 'Search Results'; } elseif ( is_day() || is_month() || is_year() ) { echo 'Archives:'; if (function_exists('meta_title')) { meta_title(); } else { wp_title(); } } else { echo bloginfo('name'); if (function_exists('meta_title')) { meta_title(); } else { wp_title(); } } ?></title> PHP:
Code is working fine. I made some more changes and everything is working fine according to my will Here is the code: <title><?php if (is_home()) { echo 'Title Text.'; } elseif (is_404()) { echo '404 Not Found'; } elseif (is_category()) { echo 'Category:'; if (function_exists('meta_title')) { meta_title(); } else { wp_title();} } elseif (is_search()) { echo 'Search Results'; } elseif ( is_day() || is_month() || is_year() ) { echo 'Archives:'; if (function_exists('meta_title')) { meta_title(); } else { wp_title(); } } else { echo bloginfo('name'); if (function_exists('meta_title')) { meta_title(); } else { wp_title(); } } ?></title> <?php if (is_home()) { echo "<meta name=\"description\" content=\"Description Text \" />\n"; } ?> PHP: Now I am able to add my own description and title meta tags Thanks for your help.