【问题标题】:How do I change the "Know More" text and link in Corporate Plus wordpress theme?如何更改 Corporate Plus wordpress 主题中的“了解更多”文本和链接?
【发布时间】:2016-09-27 02:57:34
【问题描述】:

我在 WordPress 上使用了一个名为“Corporate Plus”的主题。

问题是,我想在首页编辑一个显示“了解更多”的按钮,这是一个带有“#”链接的<a> 元素。

他们在主题选项中没有提供编辑此选项的选项,我在整个主题文件夹中找不到任何“了解更多”的实例。

如果我打开站点并检查元素,则项目的 CSS 显示在文件路径 'index(72)' > 索引文件的第 72 行。

然后我打开“查看源代码”,发现果然在第 72 行,该项目的 CSS 写在那里。

但是,“了解更多”文本位于页面文件的下方,并且主题文件夹中没有文件似乎包含“了解更多”文本。

这是怎么发生的?

如何更改“了解更多”文字?

注意:是的,我使用的是免费版本,这就是我问这个问题的原因。所以不要告诉我升级。升级在仪表板的“自定义”部分提供了选项。

【问题讨论】:

    标签: php wordpress themes customization


    【解决方案1】:

    找到corporate-plus/acmethemes/hooks/slider-selection.php。转到第 109 行并更改此代码:

    “了解更多” - 更改为您想要的任何内容。 将 href="" 更改为 href="your-link"

    【讨论】:

      【解决方案2】:

      根据您的主题自定义,您可以尝试将其添加到位于活动子主题或主题中的function.php 文件中:

      function custom_excerpt_more($more) {
          global $post;
          return '<a class="moretag" href="'. get_permalink($post->ID) . '">' . __("Your Read More Link Text", "your_theme_slug") . '</a>';
      }
      add_filter( 'excerpt_more', 'custom_excerpt_more' );
      

      WP codex: Customizing the Read More

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-11-01
        • 1970-01-01
        相关资源
        最近更新 更多