• Hi
    I have done a lot of looking around for an answer to this and thought I had found what I wanted today, I tried it but it doesn’t work.

    I want to change the Main Title Heading for some of my site pages.
    This is what my header.php is at the moment:
    <title>
    <?php wp_title(‘«’, true, ‘right’); ?>
    <?php bloginfo(‘name’); ?> </title>

    Here is some code I found and what was suggested would be the answer:

    <title><?php if(is_home()) { echo bloginfo(‘name’); echo ‘ | ‘; echo bloginfo(‘description’); } else { echo wp_title(‘ | ‘, false, right); echo bloginfo(‘name’); } ?></title>

    But after deleting the original code and replacing it with this snippet I still cannot seem to change the titles on individual pages, as soon as I make a change it changes every page the same.

    Please note here guys, I know zip about coding, it really is above my head, unless I can paste it I’m stuck, plus I don’t even know if this is even possible, any help with this will be much appreciated.

    Below is the whole contents of my header.php file.

    <?php
    /**
    * @package WordPress
    * @subpackage Default_Theme
    */
    ?>
    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;
    <html xmlns=”https://www.w3.org/1999/xhtml&#8221; <?php language_attributes(); ?>>
    <head profile=”https://gmpg.org/xfn/11″&gt;
    <meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” />

    <title>
    <?php wp_title(‘«’, true, ‘right’); ?>
    <?php bloginfo(‘name’); ?> </title>

    <?php if(get_option(‘marketing_style’)!=”){?>
    <link rel=”stylesheet” href=”<?php bloginfo(‘template_directory’); ?>/<?php echo get_option(‘marketing_style’); ?>” media=”screen” />
    <?php }else{?>
    <link rel=”stylesheet” href=”<?php bloginfo(‘template_directory’); ?>/red.php” media=”screen” />
    <?php }?>
    <link rel=”stylesheet” href=”<?php bloginfo(‘template_directory’); ?>/style.css” media=”screen” />

    <link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />
    <?php wp_head();?>
    <?php if ( is_singular() ) wp_enqueue_script( ‘comment-reply’ ); ?>

    </head>

    <!–<style type=”text/css” media=”screen”>
    @import url( <?php bloginfo(‘template_directory’); ?>/style.css );
    </style> –>
    <!–[if lte IE 6]>
    <script type=”text/javascript” src=”<?php bloginfo(‘template_directory’); ?>/iepngfix_tilebg.js”></script>
    <![endif]–>

    <body>
    <div id = “bgwrapper”>
    <div id=”light”>
    <div id = “shadow”>
    <div id = “wrap”>
    <!– Header –>
    <div id=”header”>
    <div id=”nav”>

      <li <?php if(is_home()) { ?> class=”current_page_item”<?php } ?>>
      “><span>Home</span>
      <?php wp_list_pages(‘link_before=<span>&link_after=</span>&sort_column=menu_order&depth=1&title_li=&exclude=’.getExludedItems()); ?>

    </div>
    <h3>“>
    <?php bloginfo(‘name’); ?>
    </h3>
    <p class=”tagline”>
    <?php bloginfo(‘description’); ?>
    </p>
    <div id=”rssfeeds”> “><img id=”rssicon” src=”<?php bloginfo(‘template_directory’); ?>/images/rss.png” alt=”Subscribe to RSS” />

    </div>
    </div>
    <!– End Header –>

    BTW the theme is Matt Carter’s Affiliate Marketing Theme

Viewing 6 replies - 1 through 6 (of 6 total)
  • I want to change the Main Title Heading for some of my site pages.

    that description is not detailed enough to convert into code.

    some of my site pages?
    – which ones?
    – how are you planning to define this?

    change the main title?
    – into what?
    – where would that info come from?

    – do you really mean the meta title tag? (what you tried to change is the text that appears in the browser tab)

    can you post a link to your site and give an example of what you are trying to achieve?

    Thread Starter graham333

    (@graham333)

    Hey thanks alchymyth that was very quick.

    OK, I’ll try again and simplify my question to remove any misunderstanding.
    Is it possible to make the Site Title different so that it is not the same on all pages/posts?

    Do you mean the site title displayed on your site, like in the header. Or the title displayed at the very top of your browser, outside of your website?

    the <title> controls the browser portion, has nothing to do with what you actually see on your site

    Thread Starter graham333

    (@graham333)

    Hi Rev (reverend?)

    Yes you got it, the site title displayed on my site, I am aware titles and headers can get mixed up so that’s why I specified site title.

    Please forgive my ignorance I really have no idea about what makes Wp tick, so I see from what you said there I have the wrong end of the stick.

    So am I able to change what’s displayed or am I dipping a toe in the murky waters of CSS or something here?

    Thanks for trying to help.

    well…. it can be changed, but how to do it isn’t so easy to me.

    The part that you are looking for in your header.php is

    <?php bloginfo('name');?>

    that controls the output of your blog name to the header

    What do you want there now? Post title or page title? I don’t think that will be so simple, maybe someone else can help you. The problem is that calling the title of a page or post is easily done in the loop, but not outside it so much. And even harder, on a list page, like index.php or archive.php, which title to pick, and how? So picking what to pass up to the header, and exactly how to do it is a bit of a stumbling block for me…..

    I guess we could possibly replace it with a get_posts query, query one post, and display only the title…

    maybe if you post your header.php code in a pastebin and reporta link back here, someone can take a look (I suspect a mod may delete it before somebody can take a look, large blocks of code are not allowed to be pasted directly onto the forums).
    https://wordpress.pastebin.com

    I’m heading home for the night, but I’ll check back here in the morning…..

    Thread Starter graham333

    (@graham333)

    Thanks very much for trying to help Rev, but it looks like it I have got in too deep here this is way over my head.

    Thanks anyway. ??

    Mods: Sorry guys I have pasted a large block of code, before Rev told me not to paste a large block of code. ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Site Title (Main) Can I make each page with a different main heading.’ is closed to new replies.