List of posts for a specific category

If you want to display a list of posts, including the thumbnail, there may be a conflict as I experienced, so instead of like  “Notice: Trying to get property ‘ID’ of non-object in /wp-includes/post-thumbnail-template.php on line 101″. The reason is often caused by the existence of a particular plugin.

In these circumstances, you can create your own page where you can enter the code:

Of course, the value of expression cat=80 can be set for the target category. Also, if instead of numberposts=5 (as in the picture) is chosen, for example, the value of -1 instead of five articles will show all posts. In the shown example, I intend to create a table of posts, with the first column containing the thumbnail, and the publication date and title will be displayed in the second column. Obviously, if we wanted to, we could also invoke the excerpt.

Another option is the following, inserted into a page template.

Source: ArtisansWeb

It is also interesting the article on WPbeginner.com regarding creating a shortcode to display the content of a specific category

Author: Ovidiu.S

I am quite passionate about this professional area as if I know something - no matter how little - I want to share it with others.

Leave a Reply

Your email address will not be published. Required fields are marked *