Smart Website Tools by AddThis
[Plugin: AddThis] Exclude from posts in a certain category (1 post)

  1. rwalktheplank
    Posted 3 years ago #

    Hello, I am looking for a simple function to run in my functions.php file that will allow me to set the default meta box to be in the checked state for posts in a certain category. This is as close as I have come.

    add_filter('post_metabox', 'my_post_metabox');
    function my_post_metabox($checked)
    if (in_category('27')){
    $checked = "checked";
    return $checked;


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Smart Website Tools by AddThis
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic