显示标题旁边的图标或文字-WordPress
如果帖子包含特定类别 /标签,我想做这件事,那么我想显示标题旁边显示的图标或文本。我该怎么做?这就是我所需要的,我找不到任何插件,因此我可能必须将自己的代码添加到自定义功能插件或其他地方。我对功能描述或与PHP相关的任何内容的了解很少。请帮忙
I want to make that if a post will contains a specific category / tag, then i want show icon or text displayed next to the title. How can I do this? That's all I need, and I can't find any plugins, so I'd probably have to add my own code to the Custom Functions plugin or somewhere else. My knowledge of a function description or anything related to PHP is very little. Please help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个非常简单的想法,您在数组中定义了类别。该值是类别和图像的同名。
如果类别名称在字段中,则加载图像(.jpg)并返回HTML字符串
PHP函数
,您可以在HTML文件中调用该函数作为一个示例
This is a very simple idea, you define the category in the array. The value is the same name of the category and the image.
If the category name is in the field, then load the image (.jpg) and return the html string
PHP Function
You can call the function in your HTML file with as an an example