Archived

This topic is now archived and is closed to further replies.

  • 0

hook

Question

Posted · Report post

Hi, I'd like to create a hook (if possible) to modify the <title></title> section of my pages. Basically, on all pages except the home page, I want to append the site name to the page title. Ex. for a blog page on this site it would show Blog | PageLines

Share this post


Link to post
Share on other sites

4 answers to this question

Posted · Report post

This adds a title like what I want. add_action('pagelines_code_before_head', 'add_sitename_to_title'); function add_sitename_to_title(){ echo "<title>";wp_title('|',true,'right');bloginfo('name');echo "</title>"; } The problem now is I have two titles in my head. How can I remove the pagelines default title?

Share this post


Link to post
Share on other sites

Posted · Report post

To be honest most of the SEO plugins out there will allow you to rewrite/define page titles more easily. That's what I would recommend.

Share this post


Link to post
Share on other sites

Posted · Report post

I tried the larger SEO plugins and they didn't give me what I wanted. I wound up editing the base code and commenting out the page title section in it. I'll just have to do it again with updates.

Share this post


Link to post
Share on other sites