wordpress添加页面_如何在WordPress中为帖子和页面添加字幕

wordpress添加页面

Have you ever felt that you need a subtitle for your posts and pages? Recently in one of our projects, ThemeLab, we needed to add subtitles to some of our pages. We felt that others might need it as well, so in this article we will show you how to add a secondary alternative title or subtitle in WordPress posts and pages.

您是否曾经觉得自己的帖子和页面需要字幕? 最近,在我们的一个项目ThemeLab中 ,我们需要在某些页面中添加字幕。 我们认为其他人也可能需要它,因此在本文中,我们将向您展示如何在WordPress帖子和页面中添加辅助标题或副标题。

Live demo of what it looks like on ThemeLab site:

现场演示在ThemeLab网站上的外观:

ThemeLab Subtitle

影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

First thing you need to do is install and activate the Secondary Title plugin. Upon activation, you will automatically see an additional title field below your main title on your post edit screen.

您需要做的第一件事是安装并激活Secondary Title插件。 激活后,您将在帖子编辑屏幕上的主标题下方自动看到一个附加标题字段。

Alternate title box for the secondary title in WordPress post editor

Don’t worry if you only want to use it on pages or another custom post type. The plugin comes with its own configuration options which allow you to fine tune how the secondary titles are displayed in the admin area and in your WordPress themes.

如果您只想在页面或其他自定义帖子类型上使用它,请不要担心。 该插件带有其自己的配置选项,使您可以微调辅助标题在管理区域和WordPress主题中的显示方式。

If you want to change those options, then you need to click on Settings » Secondary Title menu in the WordPress admin menu.

如果要更改这些选项,则需要单击WordPress管理菜单中的“设置”»“辅助标题”菜单。

Secondary Title Settings

On the settings screen, you can choose post types, categories, and/or specific post IDs where you want to display the secondary title. You can also choose the position of the input box on the post editor screen. This will allow you to display the secondary title box above or below the main post title box.

在设置屏幕上,可以选择要显示辅助标题的帖子类型,类别和/或特定的帖子ID。 您还可以选择输入框在帖子编辑器屏幕上的位置。 这将使您可以在主要帖子标题框的上方或下方显示辅助标题框。

By default the plugin will automatically display secondary titles however you can stop this by choosing No next to Automatic Insert option.

默认情况下,该插件将自动显示辅助标题,但是您可以通过选择 自动插入”选项旁边的“ 否”来停止显示辅助标题。

You can manually display secondary titles in your theme by using <?php get_secondary_title(); ?> template tag in your theme files. This will give you maximum control over style.

您可以使用<?php get_secondary_title(); ?>在主题中手动显示辅助标题<?php get_secondary_title(); ?> <?php get_secondary_title(); ?>主题文件中的模板标签 。 这将使您最大程度地控制样式。

The default format displays secondary title next to the post title separated by a colon, like this:

默认格式在帖子标题旁边显示辅助标题,中间用冒号分隔,如下所示:

The Post Title: The Secondary Title

The Post Title: The Secondary Title

You can change this by specifying your own format in the Title Format option on the plugin’s settings screen.

您可以通过在插件的设置屏幕上的标题格式选项中指定自己的格式来更改此设置。

Choose the display format for secondary title

This is what it looked like on the default Twenty Thirteen theme.

这就是默认的“二十三十三”主题的外观。

A WordPress post with secondary title

We hope this article helped you add alternate secondary title or subtitle to posts and pages in WordPress. We also have a tutorial on how to hide title for selective WordPress posts and pages should you need to do that.

我们希望本文能帮助您为WordPress中的帖子和页面添加辅助标题或副标题。 如果您需要这样做,我们还将提供有关如何隐藏选择性WordPress帖子和页面标题的教程。

If you liked this article, then please subscribe to our YouTube Channel for more WordPress video tutorials. You can also join us on Twitter and Google+.

如果您喜欢这篇文章,请订阅我们的YouTube频道,以获取更多WordPress视频教程。 您也可以通过TwitterGoogle+加入我们。

翻译自: https://www.wpbeginner.com/plugins/how-to-add-subtitle-for-posts-and-pages-in-wordpress/

wordpress添加页面

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值