wordpress 自定义_如何在WordPress中添加自定义后发布小部件

wordpress 自定义

Have you ever come across a website with a subscribe box after the end of their post? Or share buttons, signature, FTC disclosure, author bio, related posts, etc? In this article, we will show you how to add a widget area after your post content, so you can add any custom widgets that you like.

帖子结束后,您是否曾经浏览过带有订阅框的网站? 还是分享按钮,签名,FTC披露,作者简介,相关帖子等? 在本文中,我们将向您展示如何在帖子内容之后添加窗口小部件区域,以便您可以添加所需的任何自定义窗口小部件。

Widget areas also known as sidebars are sections in your WordPress theme where you can drag and drop any widget.

小部件区域也称为边栏,是WordPress主题中的部分,您可以在其中拖放任何小部件

Usually these widget areas either appear in the sidebar or in the footer area. You can certainly register custom widget areas, but that would require tweaking with code.

通常,这些窗口小部件区域显示在侧栏或页脚区域中。 您当然可以注册自定义窗口小部件区域 ,但这需要对代码进行调整。

Thankfully, there’s an easier way for beginners that doesn’t involve dealing with any codes.

幸运的是,对于初学者来说,有一种更简单的方法,它不需要处理任何代码。

影片教学 (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 Add Widget After Content plugin. Upon activation, simply visit the Appearance » Widgets screen, there you will see a new widget area called After Content.

您需要做的第一件事是安装并激活“ 内容后添加小部件”插件。 激活后,只需访问外观»小部件屏幕,您将看到一个名为After Content的新小部件区域。

After content widget area

Now all you need to do is simply drag and drop any widgets that you want to the After Content widget area.

现在,您只需要将所需的所有小部件拖放到After Content小部件区域。

Once you are done, you can visit any single post on your website to see the widgets below your post content.

完成后,您可以访问网站上的任何单个帖子,以查看帖子内容下方的小部件。

This solution works with all custom theme frameworks such as Genesis, Thesis, Headway Themes, etc.

该解决方案可与所有自定义主题框架一起使用,例如Genesis, ThesisHeadway Themes等。

Most good sharing plugins, email list building plugins, author bio plugins, etc give their users an option to add their widgets after post without requiring you to use this solution.

大多数优秀的共享插件电子邮件列表构建插件author bio插件等都为用户提供了一个选项,可以在发布后添加其小部件,而无需使用此解决方案。

客制化 (Customization)

If you do not want to display the widget area after a specific post, then you can turn it off.

如果您不想在特定帖子之后显示窗口小部件区域,则可以将其关闭。

Simply edit the post where you do not want to display the after post widgets. On the post edit screen, below the editor you will see the Widget After Content metabox. You can check the box next to Yes to disable the display of widget area after this particular post.

只需在不希望显示之后帖子小部件的地方编辑帖子。 在帖子编辑屏幕上,编辑器下方,您将看到“内容后的窗口小部件”元框。 您可以选中“是”旁边的框以禁用此特定帖子之后的窗口小部件区域显示。

Disable after content widgets for specific posts
内容小部件区域后的样式 (Styling After Content Widget Area)

For this part, you will need some basic CSS skills. Since the display of widgets is handled by themes, and there are so many of them, it is not possible to provide a basic style that will work for all themes. So if the after content widgets appear messed up on your site, then you need to add some CSS to fix that.

对于这一部分,您将需要一些基本的CSS技能。 由于窗口小部件的显示是由主题处理的,而且主题太多,因此不可能提供适用于所有主题的基本样式。 因此,如果内容后窗口小部件在您的网站上显得混乱,那么您需要添加一些CSS来解决此问题。

The plugin adds an awac and awac-wrapper CSS classes to the widget area. You can use these classes to modify the appearance of widget area. Here is a little something we tried in Twenty Thirteen:

该插件将awacawac-wrapper CSS类添加到小部件区域。 您可以使用这些类来修改小部件区域的外观。 这是我们在二十三岁中尝试过的一些东西:


.awac-wrapper {
margin: 0px auto;
width: 30%;
float: left;
padding: 10px;
}

The code above allowed us to display our widgets in a grid format like this:

上面的代码使我们能够以如下网格格式显示小部件:

Styling after content widgets

We hope this article helped you add a widget area after posts in WordPress.

我们希望本文能帮助您在WordPress帖子后添加小部件区域。

You may also want to check out our list of the most useful WordPress widgets for your site.

您可能还想查看我们对您站点最有用的WordPress小部件列表。

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

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterGoogle+上找到我们。

翻译自: https://www.wpbeginner.com/plugins/how-to-add-custom-after-post-widgets-in-wordpress/

wordpress 自定义

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值