简体   繁体   English

如何使WordPress的“添加/编辑帖子”形式更像Tumblr?

[英]How to make WordPress “Add/Edit Post” form more Tumblr like?

WordPress requires you give each blog post at least two fields: a title and text body content. WordPress要求您为每个博客文章至少提供两个字段:标题和文本正文内容。

I'm wondering how to modify WordPress admin so I can sometimes enter a single field for a blog post, in particular a URL, without WordPress requiring a title (related but not the point of this question: a custom theme would then know how to handle a post that only contained a URL, it would treat it like a "Link" post in Tumblr). 我想知道如何修改WordPress管理员,以便有时可以为博客文章(尤其是URL)输入一个字段,而WordPress不需要标题(相关但不是这个问题的重点:自定义主题将知道如何处理仅包含URL的帖子,则将其视为Tumblr中的“链接”帖子)。 Ideally it'd be good if the "add/edit post" form could be modified so it only contains this single URL/Link field when this is wanted. 理想的情况是,可以修改“添加/编辑帖子”表单,以便仅在需要时仅包含该URL / Link字段。

I'm guessing this is possible through a plugin but I'm not certain. 我猜这可以通过插件实现,但我不确定。 I'm hoping some smart WordPress devs are here to share and brainstorm ideas for how this could be done. 我希望一些聪明的WordPress开发人员可以在这里分享和集思广益,探讨如何实现这一目标。

Thanks in advance for any help, 预先感谢您的帮助,

Eliot 艾略特

You could use the display-part of my other answer but, instead of looping only posts, check for 'links' (builtin WP feature) as well. 您可以使用其他答案的显示部分,但也可以检查“链接”(内置WP功能),而不是仅循环发布帖子。 They are easy to manage and you can have many sets of links, which could be used like categories for your regular posts. 它们易于管理,您可以有许多链接集,这些链接可以用作常规帖子的类别。

The GUI would not handle posts well, for example in the 'post overview' table, which really would need a title. GUI无法很好地处理帖子,例如,在“帖子概述”表中,实际上需要标题。

You could use Wordpress as usual and look for a certain value of a "custom field". 您可以照常使用Wordpress并查找“自定义字段”的某个值。 Whenever one of your posts has a certain tag ( url , for example, or sykes-theme-url if you wish to namespace it), you don't render the post as a usual post but you print out the url together/without a description. 每当您的某则帖子具有特定标签(例如urlsykes-theme-url如果您希望为其命名空间)时,就不会将该帖子呈现为通常的帖子,而是将url一起打印/不打印描述。

This way you could simply skip printing the post's title for example (much like Tumblr), and instead just post the URL to that-other-place. 这样,您可以简单地跳过打印帖子标题(例如,类似于Tumblr),而只需将URL发布到其他地方。

See Custom Field-article at Smashing Magazine 参见粉碎杂志》上的自定义领域文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM