Saturday, September 10, 2022
HomeWordPress Developmentloop - Finest observe to show an inventory/archive of Customized Posts in...

loop – Finest observe to show an inventory/archive of Customized Posts in a Web page Template


I typically must have a Web page, whose content material is editable by an editor person in admin, displaying an inventory of Customized Posts.
So I create a Web page within the admin and create a Web page Template (ex : page-my_cpt.php) and run a customized WP_Query to fetch the posts inside this template. It really works, however I preserve studying that it’s not a finest observe, that working a customized WP_Query is sluggish (why is that?), and that it’s higher to make use of the pre_get_posts motion if I would like to switch the primary question.

However this may solely work when utilizing the customized publish archive template, and thus, the editor person can’t add a content material as he can do it in a Web page.

I’m confused… What do you suppose ?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments