【问题标题】:wordpress plug-in or anything that will allow us to edit the meta tags for each individual post?wordpress 插件或任何可以让我们编辑每个帖子的元标记的东西?
【发布时间】:2010-02-25 05:44:04
【问题描述】:

我在 google 进行了研究,但找不到任何东西。

是否有插件或任何东西可以让我们编辑每个帖子的元标记?

感谢帮助!谢谢。

【问题讨论】:

    标签: wordpress plugins post seo


    【解决方案1】:

    您还可以使用名为“description”的自定义字段和内置的类别描述,在没有插件的情况下使用页面、单个帖子和帖子类别中的元描述字段:

    <meta name="description" content="<?php if (is_page()) { echo get_post_meta($post->ID, 'description', true);
    
    } elseif (is_category()) { echo trim(strip_tags(category_description()));
    
    } elseif (is_single()) { echo $title = get_the_title();
    
    } else { echo bloginfo('description'); } ?>" />
    

    改编自Stupid WordPress Tricks • Perishable Press

    【讨论】:

    • 哈哈,我也想过同样的解决方案 :D 刚刚完成 ;) 还是谢谢
    【解决方案2】:

    我想有 ;例如,如果您搜索"meta tags" in wordpress' plugin lists,您会得到一些答案。


    其中一个答案是All in One SEO Pack——它的评分很高,似乎可以与最新版本的 Wordpress 一起使用,并且最近已更新。

    在这些功能中,您会看到(引用)

    • 自动生成 META 标签
    • 您可以覆盖任何标题并设置任何您想要的 META 描述和任何 META 关键字。

    【讨论】:

      【解决方案3】:

      如果页面是单个帖子并且摘录包含一些文本,我个人使用摘录字段作为元描述。 header.php 代码:

      <?php
      if (is_single() && $post->post_excerpt != “”) {
      $post = $wp_query->post;
      $descrip = strip_tags($post->post_excerpt);
      echo ‘<meta name=”description” content=”‘.$descrip.’”>’;
      }
      ?>
      

      我在this blog post详细介绍了该技术。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-06-21
        • 2012-09-06
        • 1970-01-01
        • 2011-06-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-24
        相关资源
        最近更新 更多