• Resolved xinfo

    (@xinfo)


    Hii

    i found adding auto meta tag plugin
    https://www.raoul.shacknet.nu/2006/01/05/add-meta-tags-wordpress-plugin

    problem is it show description as first few word from post and category name as keyword

    i like to show post title as descrption do its possible to modify the code

    present code in the plugin

    function amt_add_meta_tags() {
    global $posts;

    if ( is_single() ) {
    // Description
    $my_metatags = “\n<meta name=\”description\” content=\”” . strip_tags(get_the_excerpt()) . “\” />”;
    // Keywords
    $my_metatags .= “\n<meta name=\”keywords\” content=\””;
    foreach((get_the_category($posts[0]->ID)) as $cat) {
    $my_metatags .= $cat->category_nicename . ‘, ‘;
    }
    $my_metatags = substr($my_metatags, 0, -2) . “\” />\n”;
    }
    echo $my_metatags;
    }

    add_action(‘wp_head’, ‘amt_add_meta_tags’);

    ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • My advice would be to contact the plugin author. He/She would probably know how to manage that.
    Someone her with more PHP experience, certainly knows to.

    Feel invited ??

    Try altering the first $my_metatags line (under the ‘Description’ comment line) to:

    $my_metatags = "\n<meta name=\"description\" content=\"" . strip_tags($posts[0]->post_title) . "\" />";

    Thread Starter xinfo

    (@xinfo)

    Thank you Kafkaesqui

    its working Great

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘meta tag problem’ is closed to new replies.