Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi betagoo,

    there is currently no parameter to exclude posts by ID from the menu.
    Note that the plugin was not created with this in mind and, at this moment, you should do this by creating a new category and assigning the posts you want in the menu to this new category.

    As for fine-grained control, as soon as you start excluding one post at a time, it’s a small step from just manually adding the posts you want to the menu. This goes against what the plugin intends to do.

    If, of course, a significant amount of users want this functionality, I’ll reconsider. So anyone who also wants this, feel free to speak up.

    Kind regards,
    Diana

    Thread Starter betagoo

    (@betagoo)

    There is solution;

    After line 71 add code:
    delete_post_meta($nav_menu_item->ID, 'cpcm-item-exclude');

    After line 217 add code:
    $query_arr['exclude'] = get_post_meta($menu_item->db_id, "cpcm-item-exclude", true); // default value of 0 skips no posts

    After line 358 add code:
    update_post_meta( $menu_item_db_id, 'cpcm-item-exclude', (int) ($this->__empty( $_POST['menu-item-cpcm-item-exclude'][$menu_item_db_id]) ? "-1" : $_POST['menu-item-cpcm-item-exclude'][$menu_item_db_id]) );

    After line 522 add code:

    <p class="field-cpcm-item-exclude description description-thin">
    		                    <label for="edit-menu-item-cpcm-item-exclude-<?php echo $item_id; ?>">
    			                    <?php _e( 'Exclude Posts' ); ?><br />
    			                    <input type="text" id="edit-menu-item-cpcm-item-exclude-<?php echo $item_id; ?>" class="widefat code edit-menu-item-cpcm-item-exclude" name="menu-item-cpcm-item-exclude[<?php echo $item_id; ?>]" value="<?php $item_exclude = get_post_meta($item_id, "cpcm-item-exclude", true); echo $item_exclude != '' ? $item_exclude : '0'; ?>" />
    		                    </label>
    	                    </p>

    Hi betagoo,

    I hope you’ll understand that I’m reluctant to fill my plugin with each and every option that everyone asks of me. Ask yourself: is this option useful for everyone? Right now, I must conclude no.

    However, I’ve received a similar request via e-mail (i.e. adding of a custom option) and I would like to come up with an elegant way in which users can add their own custom fields to the plugin. I will look into this.

    Kind regards,
    Diana

    Thread Starter betagoo

    (@betagoo)

    I understand.
    Thank You very much.

    Hi betagoo,

    I’ve just finished implementing support for extensions. The latest Development Version of my plugin, which you can grab on the development page, now includes an additional action hook and filter, so that CPCM can be extended.

    I have included a sample plugin that extends CPCM in exactly the way you want.

    Would you be willing to grab the latest development version and give CPCM and the sample plugin a test run?

    Kind regards,
    Diana

    Thread Starter betagoo

    (@betagoo)

    Works great.
    Both methods, as plugin and as code into functions.php
    Thank You wery much.

    Hi betagoo,

    thanks a lot for trying out and reporting back! Next release version will contain this functionality ??
    Note that I’d like some more feedback on other new functionality before I release it, but it’s on its way!

    Kind regards,
    Diana

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Exclude single posts’ is closed to new replies.