WordPress.org

Ready to get started?Download WordPress

Forums

Metatags (10 posts)

  1. nieuws
    Member
    Posted 8 years ago #

    My <title> tag is different on each 'single' as i like it. I want the same thing for the description tag. So it shows a (brief) description of the post.

    Is there any way to achieve this? Perhaps something with exerpt in the meta-description?

    I asked this serveral times already but haven't received an answer so far.

  2. OnSeduction
    Member
    Posted 8 years ago #

    I think the excerpt must be within the loop. Though you probably can use some global for it.

  3. nieuws
    Member
    Posted 8 years ago #

    Yes the excerpt has to be in the loop. On the other hand, the title tag works as well.

  4. Silkjaer
    Member
    Posted 8 years ago #

    you can do a loop in the title tag..

  5. Ted1
    Member
    Posted 8 years ago #

    Yes it can be done there is a plugin for meta tags for wordpress check that out too while ur at it.

  6. nieuws
    Member
    Posted 8 years ago #

    Thanks for the hint. But it should be possible without a plugin as well i guess. Using a plugin is not very usefull for us because we write like 25 new articles per day. With the plugins you have to write your own keys for everypage.

    http://www.nieuwszicht.com

  7. OnSeduction
    Member
    Posted 8 years ago #

    <?php $xcrpt = get_the_excerpt(); echo $xcrpt; ?>

    This outputs the excerpt. But I don't think that this is the right way to do this as it should probably be in the loop. It works outside it though, but I don't have enough knowledge of the WP internals to understand it all.

  8. Kafkaesqui

    Posted 8 years ago #

    http://guff.szub.net/2005/09/01/head-meta-description/

    Trust me, it makes it easier than you think...

  9. OnSeduction
    Member
    Posted 8 years ago #

    Awesome plugin.

  10. nieuws
    Member
    Posted 8 years ago #

    I installed the plugin but nothing seems to happen. I read the instructions clearly but perhaps iam missing something.

    This is what i have now

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <head>
    <title><?php
    if(is_home()) {
    // bloginfo('tagline');
    echo 'My own title tag';
    } else {
    wp_title(""); echo ' - My site name';
    }
    ?></title>
    <META NAME="description" CONTENT="my description">
    <META NAME="keywords" CONTENT="my keys">
    <META NAME="ROBOTS" CONTENT="INDEX,FOLLOW">
    <meta http-equiv="Content-Type" content="<?php bloginfo('charset'); ?>" />
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen, projection" />
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <?php /*comments_popup_script(520, 550);*/ ?>
    <?php wp_head(); ?>

    <link href="nieuws.css" rel="stylesheet" type="text/css">
    <SCRIPT LANGUAGE="JavaScript" SRC="java.js" type="text/javascript"></script>
    <script language="Javascript" type="text/javascript" src="http://www.nieuwszicht.com/sudoku.js"></script>
    </head>

Topic Closed

This topic has been closed to new replies.

About this Topic