WordPress.org

Ready to get started?Download WordPress

Forums

addition of Title / Description / Meta? (8 posts)

  1. gravity
    Member
    Posted 9 years ago #

    Hello,
    Can someone give me the run down as to where I can add the meta tags for:
    Title
    Description
    Keywords
    Author
    etc... Be specific.. I cannot seem to find it.. Maybe I have just seen so many pages in the last few days I am going blind..
    Kind regards,
    Gravity..
    PS.. if there is any certain specific code, please let me know.

  2. gravity
    Member
    Posted 9 years ago #

    Can it just go right inside the <head></head> tags on the index page along with the other 2? Normally?

  3. eric
    Member
    Posted 9 years ago #

    yes. AFAIK anywhere between <head> and </head> is OK.

  4. imedia
    Member
    Posted 9 years ago #

    For an easy description tag, automatically tailored to each post --- open your index.php template and add this after your title and robots meta tags:


    <meta name="description" content="<?php echo htmlentities(get_the_excerpt()); ?>" />

    This will take the WordPress pre-generated excerpt for you posts, convert the appropriate characters to html, and spit out your excerpt as a description meta tag!
    Note: Even if you don't add your own excerpts, WordPress automatically makes one for you based on the first part of your post.

  5. starbug72
    Member
    Posted 9 years ago #

    That description tag works great. Thanks for posting the code!

    How do you make the title of the post, auto insert into the title tag? Maybe this is standard in the index template, but maybe I screwed that up with all the tinkering. ;)

  6. starbug72
    Member
    Posted 9 years ago #

    I figured it out... here's the code for the title tag:

    <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>

  7. snowfall
    Member
    Posted 9 years ago #

    This works great when looking at pages for individual posts, but when the blog index page is brought up on its own it seems to pick a random post to get the excerpt.

    Is there an elegant way to check to see if you are in an individual post or on the index page? That way, for the meta description, you can use your blog description for the index page and the post's excerpt for an individual post.

  8. greatbananas
    Member
    Posted 9 years ago #

    I am having the same problem as snowfall. Anyone know of a hack that does this?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.