Wordpress page category plugin

February 28, 2008

Probably many of you use wordpress as  CMS system to easily maintain your site. If you do so , you probably often needed a way to to post pages within categories. This plugin add the possibility to choose the category/categories you would like your page to go into in the process of writing/editing one page.

The installation process  is a very simple and basic one so I didn’t  make a readme or detailed instructions. Just upload it to your plugin directory and activate it. Than when you’ll go to the write page menu you’ll see the categories widget on the right sidebar.

page_category.zip

hope you find this usefull ;)

 

6 Comments for “Wordpress page category plugin”

  1. Charlene Says:

    Does this work with wp 2.7?

  2. Arsalan Says:

    I doubt that it works in WP 2.7. At least, not in my case :(

  3. Josh Salverda Says:

    Got it to work in 2.7… It doesn’t do anything though because I don’t think there is a way to link categories to pages by default.

    I’m going to keep working on it though.

    P.S. Link to my modified version of the file:

    www.joshsalverda.com/downloads/page_category.zip

  4. Daven Says:

    Okay, I just downloaded this and implemented it on my site (the revised version in post 3).

    While the widget did show up and I could select categories, none of them are showing in the indexes and the categories themselves aren’t showing any posts.

    I’m on WP 2.8.5

  5. Peter Edwards Says:

    I am running a modified version of this plugin on WP 2.8.5. I made some changes to the way the categories were displayed on the edit page screen:

    /**
    * categories4pages
    * based on Page Category plugin at http://cms.assistprogramming.com/wordpress-page-category-plugin.html
    * enahnced to make the category editing control part of the admin interface
    */
    add_action(’admin_menu’, ‘cats4pages_add_custom_box’);
    /* Adds a custom section to the “normal” Page edit screens for tags */
    function cats4pages_add_custom_box() {
    if( function_exists( ‘add_meta_box’ )) {
    add_meta_box( ‘cats4pages’, ‘Categories’,
    ‘cats4pages_inner_custom_box’, ‘page’, ’side’, ‘high’ );
    }
    }
    /* Prints the inner fields for the tag editing section */
    function cats4pages_inner_custom_box() {
    print(”);
    dropdown_categories();
    print(”);
    }

    I haven’t used this yet as the blog is relatively new, but it does put pages in categories in the database OK. One thing it doesn’t do is increment the ‘count’ field in the term_taxonomy table, so when you go to the categories page, you will not see a count for the number of pages in categories (not sure how you would do this).

    I guess for pages to turn up in a category search you would have to add a filter like this (taken from the tags4pages plugin at http://www.michelem.org/wordpress-plugin-tags4page/)

    /* add a filter to ensure pages are returned in a category search */
    add_filter(’posts_where’, ‘addpagetowhere’ );
    function addpagetowhere( $where ) {
    if( is_category() ) {
    $where = preg_replace(
    “/ ([0-9a-zA-Z_]*\.?)post_type = ‘post’/”,
    “(${1}post_type = ‘post’ OR ${1}post_type = ‘page’)”, $where );
    }
    return $where;
    }

  6. hermit Says:

    Check this page category plugin, works like a charm:

    http://maugustyniak.com/

    peace

Post a comment

Name (required)

Mail (will not be published) (required)

Website

*
To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
Click to hear an audio file of the anti-spam word