This page has been moved to http://wordpressable.me/plugins/map-categories-to-pages
Updates in version 1.2:
Compatible with WordPress 3
Why it wasn’t working with WP3
WordPress had introduced Post Types in WP2.9. The default post types are post, page, attachment, revision, and nav-menu-item. WordPress had no restriction on applying taxonomies (category and tag) on any post type but had given the option to select for “post” post type only.
In WP3, the post type needs to be registered with taxonomy to be able to attached to it. The “page” post type is not registered with Category taxonomy so the plugin wasn’t able to save categories for pages in database.
What have been changed to make it compatible with WP3
I have used register_taxonomy_for_object_type function to enable “page” post type for Categories.




{ 27 comments }
hi, Please help me, I new to wordpress… I’ve downloaded and activated your plugin but some how the option for “auto-insertion of Posts on the Pages which belong to the same category” feature does not seemed to be working even after I’ve checked the option….
Have you mapped the page to the category which you are checking?
Hi, I think this plugin is great, but i don’t know how to show pages and post of chechek in the same category, I have this (before I’ve activated the “Show the Pages on Category pages” preference), but this only shows posts, not pages on the same category:
have_posts()) : $featured_query->the_post();
$do_not_duplicate[] = $post->ID ?>
<div id="post-” >
<a href="” rel=”bookmark” title=”Permanent Link to “>
change post type before running the query.
$query->set( ‘post_type’, array( ‘post’, ‘page’ ) );
that’s works, thanks a lot!!
Hi
I Installed the pluging and did some testing with it, it worked as the page I wanted was created, but I have since removed the plugin but the page for the categories that was auto generated is still there, any idea who to get rid of this page as it just gives me a 404 ?
Many Thanks
Nik
This plugin doesn’t create any page. If you are opening a category page, you can check for permanent link structure.
Hi Amit,
I’m working on my personal site: diegograglia.net/site/
I downloaded your plugin because I’m using pages on the Nav Bar, but I can’t get some of those pages to show on the featured slideshow. The slideshow works by assigning a category to it, that’s why I thought your plugin would help.
I understand I have to edit the page.php but I don’t really see what it is that I have to do. Any help would be much appreciated.
Thanks a lot!
DG
what are these slideshows? Are these posts or are you using custom post types?
Hi Amit, thanks for your reply. The slideshow is part of the theme and it’s configured through a Featured Category. The stories featured there are posts, and I couldn’t manage to include pages there.
In the end I found a solution for what I was looking for through a different method. I created posts assigning one each to the Categories on the nav bar, so they basically look like pages, and I could still feature them on the Slides.
Best,
DG
Hi, Great plugin. Can you tell me how to show full post content on pages using your plugin? It only shows up in a list now.
See: http://www.petervanwoerden.nl/wordpress/?page_id=537
Thanks,
Peter
For this, you will have to customize your Page template. Take a look at http://amit.me/assign-categories-to-pages-in-wordpress/545#template-changes
Dear Amit:
This plugin is great. I was wondering if a categories Widget is available for this plugin.
I would like to see, in the sidebar of each page, just the subcategories of the category associated. Is that possible?
Thanks,
César
It is very much possible. I will post the code in a day or two.
Put following code in sidebar. It will display the sub-categories of the categories which are directly applied to the current page. It will not show the empty categories.
[php]
<?php
global $post;
$categories=get_the_category($post->ID);
if(count($categories)>0){
$i=1;
foreach((get_the_category($post->ID)) as $category) {
if($i==count($categories))
$includeCat.=$category->cat_ID;
else
$includeCat.=$category->cat_ID.’, ‘;
$i+=1;
}
?>
<ul><?php wp_list_categories(‘title_li=&child_of=’.$includeCat.’&show_count=0′); ?></ul>
<?php } ?>
[/php]
You can consider using http://wordpress.org/extend/plugins/php-code-widget/ to put PHP code in sidebar.
Thank you very very much for this help Amit. I will try this tomorrow and keep you updated.
I think this plugin is very important. The only way to distribute contents over pages.
Kind Regards,
César
I am glad you find it useful.
Great plugin – saves me the gray hair I was just about going to get, trying to do it myself
How can I display the assigned categories on the pages => admin page?
I can chose the category from the popup and it filters just fine – but it would be nice if it gets listed just as in the posts => admin page. Obviously the intention was there to show them as the header contains the column name for it.
Thanks!
Great plugin and saved me from getting gray hair as I was just about to try and write something the like!
Especially useful that it allows for filtering on the PAGES overview page. One problem though, it does not list the categories in the column. The header shows, but not the rows. The categories are obviously assigned as I can filter via popup.
Can you fix that?
Sorry for the late reply. Could you please put some more light on the problem with example links?
Hope this screenshot helps clarifying the problem:
http://cl.ly/2N0U1p0B2S0R1I1C2X23/category-not-showing.jpg
Got your point.
I will try and fix that.
I have done this and included in next update. Thanks for pointing it.
I tried the following code that you posted above but it errors out on the following line:
$includeCat.=$category->cat_ID.’, ‘; because of the comma. Is there a fix for that?
[php]
<?php
global $post;
$categories=get_the_category($post->ID);
if(count($categories)>0){
$i=1;
foreach((get_the_category($post->ID)) as $category) {
if($i==count($categories))
$includeCat.=$category->cat_ID;
else
$includeCat.=$category->cat_ID.’, ‘;
$i+=1;
}
?>
<ul><?php wp_list_categories(‘title_li=&child_of=’.$includeCat.’&show_count=0′); ?></ul>
<?php } ?>
[/php]
It was because of faulty single quote. Try using code given below.
[php]
<?php
global $post;
$categories=get_the_category($post->ID);
if(count($categories)>0){
$i=1;
foreach((get_the_category($post->ID)) as $category) {
if($i==count($categories))
$includeCat.=$category->cat_ID;
else
$includeCat.=$category->cat_ID.’, ‘;
$i+=1;
}
?>
<ul><?php wp_list_categories(‘title_li=&child_of=’.$includeCat.’&show_count=0′); ?></ul>
<?php } ?>
[/php]
I would like to show full posts on the pages with category. Now I can see only the clickable titles.
I know, there is some tweeking in the template files, and sure, You can give me the solution here, but would you be kind to instruct me, where to put the given lines?
I have no clue, I am not a php guy.
Thanks
Sandor
Please take a look at http://amit.me/assign-categories-to-pages-in-wordpress/545#template-changes.
This plugin has been moved to http://wordpressable.me/plugins/map-categories-to-pages. Please leave your comment at Wordpressable ME!!!
Comments on this entry are closed.