N
The Daily Insight

How do I show posts from a specific category on a page in WordPress?

Author

Sarah Oconnor

Updated on February 27, 2026

First, you need to edit the post or page where you want to display the recent posts by category. On the post edit screen, click on the add new block button (+) and then look for the ‘latest posts’ block. You will see the block appear in the content area with a preview of your recent posts.

How do I show posts on a page in WordPress?

Firstly, login to your WordPress admin dashboard, then click on ‘Settings > Reading’. Next, select the “Your latest post” option under the ‘Homepage displays’ settings. After that, click on save changes. This is the easiest method of showing posts on your home page in WordPress.

How do I display the contents of a shortcode in WordPress?

To insert shortcodes into a WordPress post:

  1. Log in to the WordPress Dashboard with your login details.
  2. In the navigation menu, click “Post”
  3. Click the post you want to edit.
  4. Click “Text”.
  5. Insert shortcode.
  6. Click “Update” to save your changes.

How do I add a category to a page in WordPress?

Once a category has been assigned to the post, and the post is published, edit the navigation menu to add the category page:

  1. Open the Customizer.
  2. Go to Menus.
  3. Select the menu to edit.
  4. Click on Add Items.
  5. Select Categories.
  6. Click the Plus icon next to the Category you want to add.
  7. Click Publish to save the changes.

How do I customize a shortcode in WordPress?

  1. Step 1: Create the Code. This is where you need to create your functionality.
  2. Step 2: Save the Code (But NOT in the Functions. php File)
  3. Step 3: Include Your Custom PHP File. Now we need to tell WordPress where to find your custom shortcode file.
  4. Step 4: Define Your Shortcode.
  5. Step 5: Add Your Shortcode.

Where are WordPress shortcodes stored?

Generally, they’re placed into a post or page. However, they can go in any location where you can add code through the WordPress editor, such as a custom post type or a text widget.

How do I display categories of my custom post type?

To get the custom post type categories you need to change the arguments passed into the wp_list_categories function. You need to define the taxonomy argument. If you have a custom post type for your products then to display all the categories for products you need to use the following snippet.

How to display all posts from a specific category in WordPress?

Now, if you want to display all your posts from a specific category on a separate page, WordPress already takes care of this for you. To find the category page, you simply need to go to Posts » Categories » View page and click on the ‘View’ link below a category.

How to create a WordPress shortcode to display posts per page?

Copy the below code snippet and add it in functions.php file located at wp-content/themes/your-theme/ . Then add this shortcode in page, post, or widgets by passing category id and other parameters in it. cat = Category id for which you want to display posts. num = Number of posts to display per page.

How to use [su_posts] shortcode in WP_query?

The [su_posts] shortcode is intended for display of posts, pages, and various post types. You can display posts from a specific category or by a specific tag. You can also choose multiple taxonomies and select the number of displayed posts. This shortcode uses WP_Query class. Relative path to the template file.

How do I show the category page in the sidebar?

There are 2 steps to show the category page in the menu and sidebar: Assign posts to categories. First, you locate Posts and choose the post that you want to add to a category. On the right, you will see Category options. Just click on your desired category and Update your change.