简体   繁体   中英

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. 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:

[catlist name="bike-rides"] (it is surrounded by ` on both sides, stackoverflow is formatting it)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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