Title: Category Posts in Custom Menu
Author: Diana van de Laarschot
Published: <strong>নৱেম্বৰ 8, 2011</strong>
Last modified: ডিচেম্বৰ 3, 2025

---

প্লাগিনৰ সন্ধান কৰক

![](https://ps.w.org/category-posts-in-custom-menu/assets/icon-128x128.png?rev=2539336)

# Category Posts in Custom Menu

 [Diana van de Laarschot](https://profiles.wordpress.org/anaid/)-ৰ দ্বাৰা

[ডাউনল’ড কৰক](https://downloads.wordpress.org/plugin/category-posts-in-custom-menu.3.0.5.zip)

 * [বিশদ বিৱৰণ](https://as.wordpress.org/plugins/category-posts-in-custom-menu/#description)
 * [পৰ্য্যালোচনা](https://as.wordpress.org/plugins/category-posts-in-custom-menu/#reviews)
 *  [ইনষ্টলেশ্যন](https://as.wordpress.org/plugins/category-posts-in-custom-menu/#installation)
 * [বিকাশ](https://as.wordpress.org/plugins/category-posts-in-custom-menu/#developers)

 [সাহায্য](https://wordpress.org/support/plugin/category-posts-in-custom-menu/)

## বৰ্ণনা

The default custom menu in WordPress only allows adding a link that leads to a list
of posts and pages belonging to a taxonomy (category, tag, etc). If you want to 
list the posts and pages themselves and if you want WordPress to do this automatically
for you, then I hope you will find this plugin useful.

**Also works for custom taxonomies and custom post types**
 **NEW: CPCM V3 now provides
support for Full Site Editing with the Gutenberg Block Editor** **WARNING: Coming
from version 1.x? There are breaking changes, read the changelog before upgrading.**

#### Using it

Enable the plugin and go to either Appearance > Menus or Appearance > Customize 
or Appearance > Editor. Add a category (or other taxonomy like tag or custom) to
the menu. Next, you can choose if you would like to replace the category by the 
posts or pages themselves.

For each Category in your menu, you now have the following extra configuration options:

 * Replace by posts in the category y/n;
 * specify the (maximum) number of posts you want to show for this item (max 10);
 * their ordering ascending or descending by Title, Date or Menu Order;
 * specify the title for the menu items. For this you can use %post_title, %post_author
   and other wildcards, see ‘Other Notes > Wildcards’. Default value: %post_title

#### Wildcards

You can control the title of the menu items generated by the plug-in with the following
wildcards:

 * %post_title
 * %post_author
 * %post_date for the unformatted post date: 2012-11-10 18:14:23
 * %post_date() for a formatted post date with the following default formatting:
   November 10th, 2012
 * %post_date(<your formatting here>) for custom date formatting. Example: %post_date(
   l jS \of F Y, h:i:s A). See [https://codex.wordpress.org/Formatting_Date_and_Time](https://codex.wordpress.org/Formatting_Date_and_Time)
   for formatting options.
 * %post_date_gmt
 * %post_date_gmt()
 * %post_date_gmt(<your formatting here>)

## স্ক্ৰীনশ্বট

 * [[
 * 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)

## ব্লকবোৰ

এই প্লাগিনটোৱে 1টা ব্লক প্ৰদান কৰে।

 *   CPCM Navigation Link Extension

## ইনষ্টলেশ্যন

 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

## সঘনাই উত্থাপিত প্ৰশ্ন

### How do I use it?

Here’s a walkthrough:

 1. Create a post with title “Post 1” and add a _new_ category “Category A”
 2. Save the post
 3. Go to Appearances > Menus (or via Appearance > Customize or Appearance > Editor,
    in WordPress 5.4 or higher)
 4. Add your category named “Category A”
 5. Open the menu item and check “Create submenu containing posts in this category.”
 6. Save the menu

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.

### Missing CSS classes

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.

### Performance issues

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;

### Can’t see it working in any way

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.

## পৰ্য্যালোচনা

![](https://secure.gravatar.com/avatar/9514e47f4f073e72bdfc209799f9e9381de74c0db83caf52db7045bdc63141b8?
s=60&d=retro&r=g)

### 󠀁[Unusable after update](https://wordpress.org/support/topic/unusable-after-update-3/)󠁿

 [nikischin](https://profiles.wordpress.org/nikischin/) জুন 9, 2024

Working version removed from archive. Super annoying.

![](https://secure.gravatar.com/avatar/4111cfcccce99617639a1224b9a66ea11b729de168f521029529cf211b314770?
s=60&d=retro&r=g)

### 󠀁[Beware ! Version 1.4.0 breaks the menu](https://wordpress.org/support/topic/beware-version-1-4-0-breaks-the-menu/)󠁿

 [weblwp](https://profiles.wordpress.org/weblwp/) জুলাই 8, 2023 2টা প্ৰত্যুত্তৰ

I suspect version 1.4.0 with the “Split Free and Premium version” makes it unusable(
without notice).

![](https://secure.gravatar.com/avatar/492bf87791e9e5a98dc092fb1e31576ddec7fa62675d1513fd1a82c55f531926?
s=60&d=retro&r=g)

### 󠀁[Thank You. This plugin is exactly what I was looking for!](https://wordpress.org/support/topic/thank-you-this-plugin-is-exactly-what-i-was-looking-for/)󠁿

 [samuelashbrook](https://profiles.wordpress.org/samuelashbrook/) ছেপ্টেম্বৰ 5, 
2022

This plugin is incredibly useful!

![](https://secure.gravatar.com/avatar/cef2b079ffb568806461ff6bef751669f6fda12e38e137d926174f76f40bfd2c?
s=60&d=retro&r=g)

### 󠀁[Life saver!!](https://wordpress.org/support/topic/life-saver-382/)󠁿

 [philipsacht](https://profiles.wordpress.org/philipsacht/) অক্টোবৰ 31, 2021

For reasons I cannot understand, Wordpress doesn’t have the possibility to display
a list of Posts determined by Post Category into a Menu/navigation area. THIS PLUGIN
DOES JUST THAT! Thank you so much for your effort – I hope you continuously will
update this plugin for all the people wanting this very simple, but important function!

![](https://secure.gravatar.com/avatar/3a43b32a0140166f447f175f9e91a42ba64eabc40e0718ffec800819299b95bf?
s=60&d=retro&r=g)

### 󠀁[Funziona benissimo](https://wordpress.org/support/topic/funziona-benissimo-3/)󠁿

 [FabriSS](https://profiles.wordpress.org/fabriss/) নৱেম্বৰ 12, 2019

Funziona benissimo con la versione 5.2.4 di wordpress e anche con installazione 
MultiSite

![](https://secure.gravatar.com/avatar/cef9778cb8b5fff408bdebfdc20f7afcdf845cab4a69f9c0912daef789b86f69?
s=60&d=retro&r=g)

### 󠀁[Just nice, simple and effective!](https://wordpress.org/support/topic/just-nice-simple-and-effective/)󠁿

 [mocotoo](https://profiles.wordpress.org/mocotoo/) জুলাই 18, 2017

Thank you, a simple way to do a menu with posts by category.

 [ আটাই 43টা পৰ্য্যালোচনা পঢ়ক ](https://wordpress.org/support/plugin/category-posts-in-custom-menu/reviews/)

## অৱদানকাৰী আৰু বিকাশকাৰীসকল

“Category Posts in Custom Menu” হৈছে মুক্ত উৎসৰ ছফ্টৱেৰ। এইসকল লোকে এই প্লাগিনত 
অৱদান আগবঢ়াইছে।

অৱদানকাৰীসকল

 *   [ Diana van de Laarschot ](https://profiles.wordpress.org/anaid/)

“Category Posts in Custom Menu” 1টা ভাষাত অনুবাদ কৰা হৈছে। [অনুবাদকসকল](https://translate.wordpress.org/projects/wp-plugins/category-posts-in-custom-menu/contributors)
ক তেওঁলোকৰ অৱদানৰ বাবে ধন্যবাদ।

[আপোনাৰ ভাষাত “Category Posts in Custom Menu” অনুবাদ কৰক।](https://translate.wordpress.org/projects/wp-plugins/category-posts-in-custom-menu)

### বিকাশৰ প্ৰতি আগ্ৰহী?

[ক’ড ব্ৰাউজ কৰক](https://plugins.trac.wordpress.org/browser/category-posts-in-custom-menu/),
[SVN ৰিপজিটৰী](https://plugins.svn.wordpress.org/category-posts-in-custom-menu/)
চাওক নাইবা [RSS](https://plugins.trac.wordpress.org/log/category-posts-in-custom-menu/?limit=100&mode=stop_on_copy&format=rss)-
দ্বাৰা [বিকাশৰ পঞ্জী](https://plugins.trac.wordpress.org/log/category-posts-in-custom-menu/)
ছাবস্ক্ৰাইব কৰক।

## সলনি-পঞ্জী

#### 3.0.5

Verified compatibility with WordPress 6.9

#### 3.0.4

Verified compatibility with WordPress 6.8

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

 * Menus can now also be managed via Appearance > Customize (Requires WordPress 
   5.4 or higher)

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

 * Premium has extra wildcards that Free doesn’t have.
 * Premium allows expanding unlimited posts; Free is limited to 10 posts.
 * Premium allows preserving the original menu item; Free always removes the category
   to replace it by the posts below it.
 * Premium allows filtering out the subcategories; Free always returns posts in 
   subcategories when the parent category is selected
 * Premium supports HTML in the label field; Free only supports plaintext.
 * Premium offers hooks to extend the plugin functionality; Free does not.

#### 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

 * Rename __empty to custom_empty to suppress PHP 7.0 validation warning as reported
   here: https://wordpress.org/support/topic/php-7-compability-2/
 * Add another sample extension (from github)
 * Update readme to reflect that it’s PHP7.0 compatible, as mentioned here: https://
   wordpress.org/support/topic/php-7-compability-2/

#### 1.2.3

 * Hide the options when ‘Create submenu …’ is not checked, thanks for contribution
   by websevendev
 * Fix compatibility issue with 4.7, resulting in options not being shown.

#### 1.2.2

 * Allow users to plug-in their own wildcards to facilitate https://wordpress.org/
   support/topic/show-category-post_category?replies=3
 * Edit readme to explain usage of the custom wp_nav_menu_item_custom_fields that
   several plugin authors have been using.
 * Add example implementation to the sample extension that shows how to extend the
   CSS classes of the menu items
 * Unit tests

#### 1.2.1

 * Only commit meta data for menu items that actually had a CPCM checkbox, reported
   here https://wordpress.org/support/topic/undefined-index-56
 * Set default skip parameter to 0, as reported here https://wordpress.org/support/
   topic/posts-assigned-to-more-than-one-category-are-not-listed-correctly?replies
   =3

#### 1.2.0

 * Fixed serious bug in versioning, which resulted in version 1.1 having no settings
   at all anymore. This fix has been tested with both both the upgrade path 1.0.1-
   > 1.2 and upgrade path 1.0.1 -> 1.1 -> 1.2, both upgrade paths should be fined
   now. My sincere apologies to all who experienced this issue.
 * Fixed debug errors as reported here https://wordpress.org/support/topic/undefined-
   index-56?replies=7

#### 1.1

 * Process custom fields last, so that users cannot override the built-in options
   like %post_featured_image with a custom field named “featured_image”. As reported
   here https://wordpress.org/support/topic/category-lastes-post-with-images?replies
   =7#post-7052239
 * Allow others to extend my CPCM plugin with their own fields. Also includes a 
   sample that shows how to do this. https://wordpress.org/support/topic/exclude-
   single-posts?replies=5
 * Some comments and code formatting
 * Introduced plugin versioning in code in order to perform data conversion
 * Converted “cpcm-” custom fields to “_cpcm-” so that they don’t show on post edit
   pages and the like.
 * Update contact information
 * Ensure that excluding subcategories now also works for custom taxonomies. Only
   show the dropdown for hierarchical taxonomies. (Tags no longer show ‘Subcategory
   posts’ dropdown.)
 * Add custom CSS classes, as suggested here https://wordpress.org/support/topic/
   adding-css-classes-to-the-newly-displayed-menu-items

#### 1.0.1

 * Added hook wp_nav_menu_item_custom_fields for compatibility with other plug-ins
   adding fields to the Appearances > Menus page.
 * Fix for CSS class bugs reported by brangelo in https://wordpress.org/support/
   topic/works-with-41-as-far-as-i-can-tell?replies=5.
 * Bugfix: normal menu items that were below a menu item removed by cpcm, are now
   repositioned in the menu correctly.
 * Bugfix for subcategories with a single post with setting remove=”only if empty”:“
   For example, I have a parent category A with sub categories A1, A2 and A3. I 
   have all sub categories set to remove only if there are no posts. Subcat A1 displays
   with submenu of posts (2), subcats A2 and A3 do not display and their posts (
   1 each) show directly under the parent as posts links.”

#### 1.0

 * Bugfix: Correctly set the menu item parents. Relevant when nesting categories
   with ‘Create submenu’ checked.
 * First implementation (WIP) for request: https://wordpress.org/support/topic/replace-
   category-link-with-link-to-first-post?replies=10
    When the menu item is marked
   as remove “always” or “only if empty” and there was one post, then make sure 
   that any childen of the menu item become children of this single post.
 * Implement skip-parameter
 * Implemented exclusion of subcategories, useful alternative to https://wordpress.
   org/support/topic/is-it-possible-to-get-sub-category-post-nested

#### 0.9.5

 * Fixed https://wordpress.org/support/topic/great-job-please-contact-me?replies
   =2. You can now specify 0 in ‘Number of posts’. That way, the category can be
   shown/hidden based on whether it is empty or not.
 * Fixed https://wordpress.org/support/topic/post_date. Forward slash is now accepted
   in date formatting.

#### 0.9.4

 * Fix https://wordpress.org/support/topic/date-fields-for-menu-title-dont-work 
   due to variable $string that has been moved out of the global scope in new WordPress
   release.

#### 0.9.3

 * Fix https://wordpress.org/support/topic/issue-with-default-wordpress-sidebar-
   menu
 * Fix https://wordpress.org/support/topic/menu-do-not-include-the-current-menu-
   parent-class
 * Add support for auto-generated image tags, see https://wordpress.org/support/
   topic/images-showing-url-instead-of-actual-image

#### 0.9.2

 * Fixed bug introduced in 0.9.1 with respect to old PHP versions (5.2 and before)
   https://wordpress.org/support/topic/unexpected-t_function-1
 * Introduced an extra ordering option ‘Menu Order’, as suggested here: https://
   wordpress.org/support/topic/extend-orderby-to-menu_order

#### 0.9.1

 * Edits for strict mode (https://wordpress.org/support/topic/edits-for-strict-mode)
 * Add thumbnail option with posts (https://wordpress.org/support/topic/add-thumbnail-
   option-with-posts)
 * PHP 5.5 preg_replace() /e modifier deprecated (https://wordpress.org/support/
   topic/php-55-preg_replace-e-modifier-depricated)

#### 0.9

 * Fixed CSS ‘active’ class problem: CSS classes are no longer copied from the parent
   menu item to the menu item for the posts/pages.

#### 0.8

 * Added the option to keep or remove the original menu item. Initially, the original
   menu item was replaced by the list of its posts, but now you can choose for yourself
   whether this should be done (always / only if there are no posts / never)

#### 0.7.2

 * Bugfix: Fixed invalid argument error reported by macrocurio in Plugin Support.

#### 0.7.1

 * Bugfix: Link Target, CSS Classes, Link Relationship (XFN) and Description weren’t
   inherited from the original menu item. They are now.

#### 0.7

 * Added support for custom post types
 * Fixed user_data bug
 * Added date formatting options

#### 0.6

 * Added a bunch of wildcards: %post_feat_image (url only), %post_excerpt, %post_url,%
   post_date, %post_date_gmt, %post_status, %post_modified, %post_modified_gmt, %
   post_comment_count

#### 0.5

 * Enable custom taxonomies.
 * Change plugin URL.

#### 0.4

 * Fix plugin bug for Tags, probably related to 3.2.2 update.
 * Edit documentation
 * Change some CSS to show checkbox next to label instead of above it.
 * Edit text in menu item block to clarify use of custom fields.

#### 0.3

 * Extended the plugin for use of custom fields. Use a custom field with name ‘my
   field’ with wildcard %post_my_field. Note that if the post does not have this
   custom field, the wildcard is removed (it is not replaced by anything).

#### 0.2

 * Extended the plugin to post tags. Note that the plugin name has unfortunately
   _not_ been changed to reflect this extension.

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

 * Enable/disable per taxonomy item whether you want to replace it by its posts
 * Specify the (maximum) number of posts that should be displayed.
 * Specify the ordering (Descending/Ascending) and the field to order by (ID, title,
   etc..)
 * Set a title for the menu items. For this you can use the wildcards %post_title
   and %post_author.

## মেটা

 *  **3.0.5** সংস্কৰণ
 *  **5 মাহ আগত** শেষবাৰ আপডে’ট হৈছিল
 *  সক্ৰিয় ইনষ্টলেশ্যন **2,000+**
 *  WordPress-ৰ সংস্কৰণ ** 5.4 বা তাতকৈ ওপৰৰ **
 *  ইমানলৈকে পৰীক্ষা কৰা হৈছে **6.9.4**
 *  PHP-ৰ সংস্কৰণ ** 7.4 বা তাতকৈ ওপৰৰ **
 *  ভাষাবোৰ
 * [English (US)](https://wordpress.org/plugins/category-posts-in-custom-menu/) 
   আৰু [German](https://de.wordpress.org/plugins/category-posts-in-custom-menu/).
 *  [আপোনাৰ ভাষাত অনুবাদ কৰক](https://translate.wordpress.org/projects/wp-plugins/category-posts-in-custom-menu)
 * [automatic](https://as.wordpress.org/plugins/tags/automatic/)[category](https://as.wordpress.org/plugins/tags/category/)
   [Dynamic](https://as.wordpress.org/plugins/tags/dynamic/)[menu](https://as.wordpress.org/plugins/tags/menu/)
   [submenu](https://as.wordpress.org/plugins/tags/submenu/)
 *  টেগবোৰ
 *  [উচ্চখাপৰ ভিউ](https://as.wordpress.org/plugins/category-posts-in-custom-menu/advanced/)

## ৰে’টিংবোৰ

 5টাৰ ভিতৰত 4.8টা তৰা।

 *  [  39 5-star reviews     ](https://wordpress.org/support/plugin/category-posts-in-custom-menu/reviews/?filter=5)
 *  [  2 4-star reviews     ](https://wordpress.org/support/plugin/category-posts-in-custom-menu/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/category-posts-in-custom-menu/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/category-posts-in-custom-menu/reviews/?filter=2)
 *  [  2 1-star reviews     ](https://wordpress.org/support/plugin/category-posts-in-custom-menu/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/category-posts-in-custom-menu/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/category-posts-in-custom-menu/reviews/)

## অৱদানকাৰীসকল

 *   [ Diana van de Laarschot ](https://profiles.wordpress.org/anaid/)

## সাহায্য

কিবা ক’বলগীয়া আছে? সহায় লাগে?

 [সাহায্যৰ ফ’ৰাম চাওক](https://wordpress.org/support/plugin/category-posts-in-custom-menu/)

## দান কৰক

আপুনি এই প্লাগিনৰ উন্নতিৰ প্ৰতি সাহায্য আগবঢ়াব বিচাৰেনে?

 [ এই প্লাগিনক অনুদান দিয়ক ](https://wordpress.telodelic.nl/category-posts-in-custom-menu)