Forums

Page meta: what should I change in header.php file (2 posts)

  1. Tritonus
    Member
    Posted 3 weeks ago #

    Hi.

    I've just installed the plugin 'pagemeta'. It sais that I should change <?php meta_title(); ?>to<?php if (function_exists('meta_title')) { meta_title(); } else { wp_title(); } ?>` in my header template, but I can't find the code I need to change.

    My header template looks as follows:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    
    <title>
    		<?php if ( is_home() ) { ?><?php bloginfo('description'); ?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_search() ) { ?><?php echo $s; ?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_single() ) { ?><?php wp_title(''); ?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_page() ) { ?><?php wp_title(''); ?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_category() ) { ?>Archive <?php single_cat_title(); ?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_month() ) { ?>Archive <?php the_time('F'); ?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_tag() ) { ?><?php single_tag_title();?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_404() ) { ?>Sorry, not found! | <? bloginfo('name'); ?><?php } ?>
    </title>
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/nav.css" type="text/css" media="screen" />
    <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/dropdowns.js"></script>
    <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <?php wp_head(); ?>
    
    </head>
    
    <body>
    
    <div id="page">
    
    <div id="header">
    
    	<h2 id="blog-description"><? bloginfo('description'); ?></h2>
    	<h1><a href="<?php bloginfo('url'); ?>"><? bloginfo('name'); ?></a></h1>
    
    	<ul id="nav">
    		<li class="page_item current_page_item" id="first"><a href="<?php bloginfo('url'); ?>">Home</a></li>
    		<?php wp_list_pages('title_li=&depth=2&sort_column=menu_order'); ?>
    	</ul>
    	<ul id="top-nav">
    
    		<li id="rss"><a href="<?php bloginfo('rss2_url'); ?>">Subscribe RSS Feed</a></li>
    	</ul>
    
    	<div class="clear"></div>
    
    </div>
    
    <!-- end header -->

    Does someone know what part of the code I have to change?
    Thanks! :)
    - Lasse.

  2. alism
    Member
    Posted 3 weeks ago #

    Presumably it means change:

    <title>
    		<?php if ( is_home() ) { ?><?php bloginfo('description'); ?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_search() ) { ?><?php echo $s; ?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_single() ) { ?><?php wp_title(''); ?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_page() ) { ?><?php wp_title(''); ?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_category() ) { ?>Archive <?php single_cat_title(); ?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_month() ) { ?>Archive <?php the_time('F'); ?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_tag() ) { ?><?php single_tag_title();?> | <? bloginfo('name'); ?><?php } ?>
    		<?php if ( is_404() ) { ?>Sorry, not found! | <? bloginfo('name'); ?><?php } ?>
    </title>

    to:

    <title><?php if (function_exists('meta_title')) { meta_title(); } else { wp_title(); } ?></title>

Reply

You must log in to post.

About this Topic