Category Posts in Custom Menu

Category Posts in Custom Menu

Dynamic menus: List all posts from a category in your menu. Also works for tags, custom taxonomies as well as pages and custom post types.

  • Almost active
    This plugin was not updated the last 249 days ago.
  • This plugin is tested with the last major release of WordPress
    Content for list item
  • Compatible with the latest major PHP release
    This plugin requieres PHP 7.4 or higher. The latest stable PHP 8.4.10 was released on 03 July 2025
  • No information about vulnerabilities and unfixed security issues is available.
    Content for list item

Ratings

43

Active installs

2K

Total Downloads

99K

Support Threads

0

Last updated

04 November 2024

Added

08 November 2011

Versions

24.45%16.68%53.9%4.97%
  • Version 1.2
  • Version 1.3
  • Version 3.0
  • Version other

Screenshots

Go to Appearance > Menu to enable/disable and set the options for the replacement of Category / Post Tag links by their posts.
Go to Appearance > Customize to enable/disable and set the options for the replacement of Category / Post Tag links by their posts. (Requires WordPress 5.4 or higher)
Go to Appearance > Editor to enable/disable and set the options for the replacement of Category / Post Tag links by their posts. (Requires WordPress 6.1 or higher)

About Category Posts in Custom Menu

FAQ

Here’s a walkthrough:

If you now look at your website, “Category A” is replaced by “Post 1”. Add additional posts to Category A and you will automatically see these additional posts in the menu.

The CSS class ‘current-post-ancestor’ is not applied correctly. This is a bug in WordPress that I have reported here: https://core.trac.wordpress.org/ticket/32918 This is not something I am able to fix in the plugin, it has to be fixed in WordPress. I’m sorry for the inconvenience.

The plugin is potentially very expensive, especially when you decide to build your entire menu out of nothing but category posts.

The solution would be to cache the menu using transients, as reported here https://wordpress.org/support/topic/performance-problem-many-database-queries?replies=11#post-7829450

$my_cached_menu = get_transient( ‘my_cached_menu’);

if( $my_cached_menu === false )

{

$my_cached_menu = wp_nav_menu( … );

set_transient( “my_cached_menu_”, $my_cached_menu, YEAR_IN_SECONDS );

}

echo $my_cached_menu;

Problem: “I can’t see what effect it has had. Nothing has changed (not that I can see) in the Appearance > Menu/Customize/Editor pages. It’s just like before.”

If you are using a recent version of category Posts in Custom Menu and an updated version of WordPress, the problem can only occur due to your theme or other plugins conflicting with Category Posts in Custom Menu. Please disable all themes and plugins except CPCM; verify that the CPCM fields show; enable other plugins and themes one by one to determine which plugin/theme conflicts with CPCM.

Note: A theme must either call wp_nav_menu() or apply_filters( ‘wp_nav_menu_objects’, … ) for CPCM to be triggered.

The CSS class ‘current-post-ancestor’ is not applied correctly. This is a bug in WordPress that I have reported here: https://core.trac.wordpress.org/ticket/32918 This is not something I am able to fix in the plugin, it has to be fixed in WordPress. I’m sorry for the inconvenience.

The plugin is potentially very expensive, especially when you decide to build your entire menu out of nothing but category posts.

The solution would be to cache the menu using transients, as reported here https://wordpress.org/support/topic/performance-problem-many-database-queries?replies=11#post-7829450

$my_cached_menu = get_transient( ‘my_cached_menu’);

if( $my_cached_menu === false )

{

$my_cached_menu = wp_nav_menu( … );

set_transient( “my_cached_menu_”, $my_cached_menu, YEAR_IN_SECONDS );

}

echo $my_cached_menu;

Problem: “I can’t see what effect it has had. Nothing has changed (not that I can see) in the Appearance > Menu/Customize/Editor pages. It’s just like before.”

If you are using a recent version of category Posts in Custom Menu and an updated version of WordPress, the problem can only occur due to your theme or other plugins conflicting with Category Posts in Custom Menu. Please disable all themes and plugins except CPCM; verify that the CPCM fields show; enable other plugins and themes one by one to determine which plugin/theme conflicts with CPCM.

Note: A theme must either call wp_nav_menu() or apply_filters( ‘wp_nav_menu_objects’, … ) for CPCM to be triggered.

The plugin is potentially very expensive, especially when you decide to build your entire menu out of nothing but category posts.

The solution would be to cache the menu using transients, as reported here https://wordpress.org/support/topic/performance-problem-many-database-queries?replies=11#post-7829450

$my_cached_menu = get_transient( ‘my_cached_menu’);

if( $my_cached_menu === false )

{

$my_cached_menu = wp_nav_menu( … );

set_transient( “my_cached_menu_”, $my_cached_menu, YEAR_IN_SECONDS );

}

echo $my_cached_menu;

Problem: “I can’t see what effect it has had. Nothing has changed (not that I can see) in the Appearance > Menu/Customize/Editor pages. It’s just like before.”

If you are using a recent version of category Posts in Custom Menu and an updated version of WordPress, the problem can only occur due to your theme or other plugins conflicting with Category Posts in Custom Menu. Please disable all themes and plugins except CPCM; verify that the CPCM fields show; enable other plugins and themes one by one to determine which plugin/theme conflicts with CPCM.

Note: A theme must either call wp_nav_menu() or apply_filters( ‘wp_nav_menu_objects’, … ) for CPCM to be triggered.

Problem: “I can’t see what effect it has had. Nothing has changed (not that I can see) in the Appearance > Menu/Customize/Editor pages. It’s just like before.”

If you are using a recent version of category Posts in Custom Menu and an updated version of WordPress, the problem can only occur due to your theme or other plugins conflicting with Category Posts in Custom Menu. Please disable all themes and plugins except CPCM; verify that the CPCM fields show; enable other plugins and themes one by one to determine which plugin/theme conflicts with CPCM.

Note: A theme must either call wp_nav_menu() or apply_filters( ‘wp_nav_menu_objects’, … ) for CPCM to be triggered.

Changelog

3.0.3

Verified compatibility with WordPress 6.7

3.0.2

Verified compatibility with WordPress 6.6

3.0.0

Now provides support for Full Site Editing with the Gutenberg Block Editor.
Dropped support for WordPress 4.x, plugin now requires WordPress 5.4 or higher.
Verified compatibility with WordPress 6.5

2.1.2

Verified compatibility with WordPress 6.4.

2.1.1

Free version now also supports sorting by Menu Order.

2.1.0

Verified compatibility with WordPress 6.3.
Also re-verified compatibility with older versions: Tested against 4.9.23 and 5.9.7

New functionality:

2.0.0

WARNING: Version 2.0 has breaking changes! See changelog.

Bugfix: On some mobile themes, the dropdown caret did not show. (As reported here: https://wordpress.org/support/topic/mobile-sub-menu-3/, and here: https://wordpress.org/support/topic/not-working-on-mobile-devices-16/)

Split Free and Premium version:

1.3.0

Now compatible with WordPress 5.7.
If you are on a WordPress version between 4.7 and 5.7.2, when encountering issues please report the WordPress version you’re running.

1.2.4

1.2.3

1.2.2

1.2.1

1.2.0

1.1

1.0.1

1.0

0.9.5

0.9.4

0.9.3

0.9.2

0.9.1

0.9

0.8

0.7.2

0.7.1

0.7

0.6

0.5

0.4

0.3

0.2

Added checkboxes, dropdowns and text fields to Appearance > Menu. It is now possible to:

How to install Category Posts in Custom Menu

  1. Go to plugins in your dashboard and select “Add New”
  2. Search for “CPCM” or “Category Posts in Custom Menu”
  3. Install and Activate the plugin