• crakbot

    (@crakbot)


    I’ve been trying to figure this out on my own and I can’t seem to do it.

    I want to add a title and tagline (the ones that show up in the title bar in the browser) into my blogs main page but without entering it in the options since I am using a custom header and I don’t need the title to show up over it. I tried just adding a title into the the header.php file but then it gives all my pages the same title instead of the post title for each page.

    How do I set up a title and description for the main page and still keep the post page titles unique.

    Sorry I’m still learning all the coding as I go.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Root

    (@root)

    I would do the following:
    Because you want the first page to behave differently to the rest I would save index.php as home.php. home.php will then be the front page. For home.php I would add the h1 and the tagline in the options panel as usual. In the CSS I would then move the h1 and tagline left by 9000px so they do not show up. That will do it.

    zoutesnor

    (@zoutesnor)

    Do this:

    if ( is_home()) {
    set up title and description
    }

    Doodlebee

    (@doodlebee)

    Actually, I asked this same question a long while ago. The wp_head() function in your header is *perfect* for this.

    For the record, there *are* plugins that will do this for you, but the solution I got was pretty cool, too. The basic solution was the following (provided by Otto)

    Open up Notepad, and put this in:

    <?php
    function add_some_meta_flavor()
    { ?>
    <title><?php echo $title ?></title>
    <meta name="description" content="<?php echo $description ?>" />
    <meta name="keywords" content="<?php echo $keywords ?>" />
    <?php }
    add_action('wp_head','add_some_meta_flavor');
    ?>

    Save the file as “functions.php” and upload to whatever theme folder you’re using. If you already *have* a functions.php file, then just add the above code to the bottom of it.

    Now, on your Pages that you want to have different keywords and titles, at the very top of the Page template file, just add in:

    <?php
    
    $title = "title for the Page here";
    $keywords = "keywords here";
    $description = "description here";
    
    ?>

    Then when the page is called up, it’ll see your variables in the Page template and call in whatever you’ve specified for each Page. The drawback to this method is that you have to create a Page template for every single Page – but I would say that you could probably create *one* and use conditionals to send the right stuff to the correct pages.

    It’s worked like a charm for me for quite a while ??

    kurtposer

    (@kurtposer)

    doublebee,

    Are there plugins that will do this for me, as I would like to do this from within the back-office of my WordPress blog? A recent plugin I used (SEO Tile Tag) allows me to identify a different Title Tag than the one displayed on my page if I want, and this is great. Is there one that activates the tagline from the Options-General section of my blog’s back-office so that search engines see it? Right now I can enter a tagline, but they aren’t seen by search engines.

    Thanks for your help.

    Kurt

    kurtposer

    (@kurtposer)

    Oops. I forgot a link to my blog.

    moshu

    (@moshu)

    Is there one that activates the tagline from the Options-General section of my blog’s back-office

    That’s a theme related issue. You don’t need any plugin. You switch to another theme or edit yours.
    Check the default and/or classic to see the code used.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Help with title.’ is closed to new replies.