Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Blogs and Blogging (http://www.greenguysboard.com/board/forumdisplay.php?f=8)
-   -   Wordpress: How to change post page titles? (http://www.greenguysboard.com/board/showthread.php?t=29637)

Ms Naughty 2006-03-07 06:11 PM

Wordpress: How to change post page titles?
 
Hi all
Haven't had much luck in finding info on this so I'm hoping someone here has a quick answer.

I can't find the setting on Wordpress to change what it puts in the tags for each post page. This means that all my individual post pages have a title that says:<br /> Ms Naughty Porn for Women Blog : Blog Archive : <Post name><br /> <br /> I want the post name to appear first.<br /> <br /> Any suggestions on how to do this?<br /> <br /> Thanks<br /> <br /> Karen</div> </td> </tr> </table> <br /><table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%"> <tr> <td class="page"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr valign="bottom"> <td style="font-size:14pt">RawAlex</td> <td class="smallfont" align="right">2006-03-07 06:24 PM</td> </tr> </table> <hr /> <div>It is in the header.php of your template you will find this code:<br /> <br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left"><title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?>
The first part bloginfo('name') shows the title of your site as defined. The second part (is_single) checks to see if this is a single post, if it is, it puts up the words Blog Archive followed by the title of the post.

That is where it comes from... you can re-arrange or remove the parts as needed, but remember, the same code is run on the main pages and other pages as well, so you have to be a little inventive, and check out what you doing and how it affects other pages.

Alex

Ms Naughty 2006-03-07 07:31 PM

Eek!
Thanks for helping Alex! Unfortunately my php skills are exceedingly close to zero, so I'm very hesitant to do any editing.

Have you got a suggestion for rearranging that code so it goes:
Post Title : Blog Title

Would it work if I did this?
<?php wp_title(); ?><?php bloginfo('name'); ?>

RawAlex 2006-03-07 11:18 PM

You might want to try:

<?php wp_title(); ?><?php if ( is_single() ) { ?> : <?php } ?><?php bloginfo('name'); ?>

That should work, and won't give you a blank : at the start of regular pages. As always, keep a backup of the previous version before you start.

Alex

Ms Naughty 2006-03-08 12:14 AM

Thanks Alex, I'll give it a go :D

Ms Naughty 2006-03-08 03:33 AM

YAY! I got it to work!!!
And it only took six goes!
Thanks for your help Alex

RawAlex 2006-03-08 08:30 AM

:)


All times are GMT -4. The time now is 07:48 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc