Jump to content


Photo
- - - - -

hook


This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1 simplespirit

simplespirit

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 29 December 2010 - 01:02 PM

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

#2 simplespirit

simplespirit

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 29 December 2010 - 01:39 PM

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?

#3 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 29 December 2010 - 06:08 PM

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.

#4 simplespirit

simplespirit

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 30 December 2010 - 06:49 PM

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.

#5 bryan-hadaway

bryan-hadaway

    Advocate

  • Members
  • PipPipPipPipPip
  • 3697 posts

Posted 31 December 2010 - 07:31 AM

Please Login or Register to see this Hidden Content

That plugin by default does what I used to manually do. If it didn't it would give me complete control over the titles if I wanted to customize. Spend some time with it and it'll be much easier. Thanks, Bryan