标记列表的Wordpress简码 [英] Wordpress shortcode for tag list

查看:96
本文介绍了标记列表的Wordpress简码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在帖子中的确切位置插入(帖子的)标签. (默认值:他们追赶)

据我了解,唯一的方法是使用简码并将其描述写在函数中.我认为这很容易,其中包括"print $ tags_list",但我还没有编写出所需的全部代码.
你能帮助我吗?还是建议其他方法来解决我的问题?
PS:也许另一种方法是在帖子中插入标签代码,但是wordpress编辑器不理解

I need to insert tags (of the post) inside post in the exact place. (default: they go after)

As I understand the only way is to use shortcode and write its description in functions. I think its an easy one including "print $tags_list", but I haven't managed to write the whole piece of code needed.
Can you help me? Or advise another way to solve my problem?
PS: Maybe another way is to insert tag code inside post, but wordpress editor doesn't understand

推荐答案

除非职位的职位发生变化,否则您实际上不需要简码.

You don't really need a shortcode unless the position changes per post.

要在模板中呈现标签(您可以移动代码):

To render tags in your template (you could just move the code):

 <?php the_tags(); ?>

如果您想输入简码:

function sc_taglist(){

    return get_the_tag_list();
}
add_shortcode('tags', 'sc_taglist');

并使用[标签]

这篇关于标记列表的Wordpress简码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆