Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Page Title on Blog Page WordPress

  • REFUNDED

I'm using Wordpress as a CMS and have my front page set to a static page, then my posts page set to a page titled "Reference."

In my theme the page title is set to display in large type before the content. On the blog page, instead of saying 'Reference' it says the title of the post. It is causing my dynamic menu problems as well.

You can see what I mean here: [[LINK href="http://shopnewera.com/reference/"]]http://shopnewera.com/reference/[[/LINK]].

I know that it is showing the blog title because of I'm using the <?php the_title(); ?> tag, but I can't find which tag I should be using. Below is my code for the header.

Thanks!

<?php ?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php
/*
* Print the <title> tag based on what is being viewed.
* We filter the output of wp_title() a bit -- see
* twentyten_filter_wp_title() in functions.php.
*/
wp_title( '|', true, 'right' );

?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
/* We add some JavaScript to pages with the comment form
* to support sites with threaded comments (when in use).
*/
if ( is_singular() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );

/* Always have wp_head() just before the closing </head>
* tag of your theme, or you will break many plugins, which
* generally use this hook to add elements to <head> such
* as styles, scripts, and meta tags.
*/
wp_head();
?>

<?php
if ( is_page('new-era') ) { $current = 'one'; }
elseif ( is_page('collection') ) { $current = 'two'; }
elseif ( is_page('reference') ) { $current = 'three'; }
elseif ( is_page('information') ) { $current = 'four'; }
elseif ( is_page('checkout') ) { $current = 'five'; }
?>

<style type="text/css">
#<?php echo $current; ?> {
font-weight: bold;
}
</style>

</head>

<body <?php body_class(); ?>>

<div id="page-wrap">

<div id="menu-bar">
<ul id="main-nav">
<li id="five"><a href="/collection/checkout/">CHECKOUT</a></li>
<li id="four"><a href="/information/">Information</a> /</li>
<li id="three"><a href="/reference/">Reference</a> /</li>
<li id="two"><a href="/collection/">Collection</a> /</li>
<li id="one"><a href="/">New Era</a> /</li>

</ul>

<div class="clear"></div>
</div>

<hr color="#000000" width="940px">

<div id="page-title">
<?php if ( is_front_page() ) { ?>
<h1><?php the_title(); ?></h1>
<?php } else { ?>
<h1><?php the_title(); ?></h1>
<?php } ?>
</div>
<div class="clear"></div>
<hr color="#000000" width="940px">

Answers (5)

2011-01-28

Joachim Kudish answers:

I am confused about what the problem actually is. What do you want the title to say on that page?

2011-01-28

Baki Goxhaj answers:

Here:

single_post_title()

2011-01-28

Jim Dugan answers:

http://digwp.com/2009/06/custom-wordpress-title-tags/

does a good job of explaining how to tweak your title tag for SEO etc.

2011-01-28

Sébastien | French WordpressDesigner answers:

replace

<?php if ( is_front_page() ) { ?>

<h1><?php the_title(); ?></h1>

<?php } else { ?>

<h1><?php the_title(); ?></h1>

<?php } ?>



by
<?php if ( is_front_page() ) { ?>

<h1><?php the_title(); ?></h1>

<?php } elseif (is_single()) {
$category = get_the_category();
echo $category[0]->cat_name;
} else { ?>

<h1><?php the_title(); ?></h1>

<?php } ?>




With this code, in a page like this : [[LINK href="http://shopnewera.com/collection/spring-2011/jasper-001/"]]http://shopnewera.com/collection/spring-2011/jasper-001/[[/LINK]] the big title will be "references" instead of "jasper-001". Is it right what you want ?

2011-01-28

Victor Teixeira answers:

Replace:


<div id="page-title">

<?php if ( is_front_page() ) { ?>

<h1><?php the_title(); ?></h1>

<?php } else { ?>

<h1><?php the_title(); ?></h1>

<?php } ?>

</div>



With:



<div id="page-title">

<?php if ( is_front_page() && is_page() ) { ?>

<h1><?php the_title(); ?></h1>

<?php } elseif ( is_single() ) { ?>

<h1>Reference</h1>

<?php } ?>

</div>



Should work!


Victor Teixeira comments:

Also take a look if you have a single.php file. Then on that file you should have:


<div id="page-title">

<h1>Reference</h1>

</div>