简体   繁体   English

列出类别帖子Wordpress插件不起作用

[英]List Category posts Wordpress plugin not working

I am new to WordPress and trying to use the List Category WordPress plugin to show posts by category on the home page. 我是WordPress的新手,并尝试使用List Category WordPress插件在首页上按类别显示帖子。 I have installed and activated the plugin and as given in their documentation ( https://github.com/picandocodigo/List-Category-Posts/blob/master/readme.txt ), added the following code to the index.php file to get posts by category name: 我已经安装并激活了该插件,并按照其文档中的说明进行了安装( https://github.com/picandocodigo/List-Category-Posts/blob/master/readme.txt ),将以下代码添加到index.php文件中,按类别名称获取帖子:

[catlist name="bike-rides"] (it is surrounded by ` on both sides, stackoverflow is formatting it) [catlist name="bike-rides"] (两边都被`包围,stackoverflow正在格式化它)

On adding this code, this text shows up on the website instead of showing posts by this category. 添加此代码后,此文本将显示在网站上,而不是显示该类别的帖子。 在此处输入图片说明

Can anyone please help? 谁能帮忙吗? I am probably doing something very stupid so please bear with me. 我可能正在做一些非常愚蠢的事情,所以请忍受我。

Hi can you please try this 嗨,你能试试看吗

<?php echo do_shortcode( '[catlist name="bike-rides"]' ); ?>

we should use do_shortcode function to insert shortcodes inside php files in wordpress, pls try it 我们应该使用do_shortcode函数在wordpress中的php文件中插入简码,请尝试一下

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

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