WP-Plugins

Map Categories to Pages

Download from WordPress

Updates in version 1.3.2:
1. Added pagination in auto-insertion. Number of posts per page are be displayed from “Blog pages show at most” settings from “Reading” option page. Use following CSS classes to change styles.
.navigation
.alignleft
.alignright

Updates in version 1.3.1:
1. Exclude Category IDs option on Widget.

Updates in version 1.3:

Widget to display pages from the Page’s category.

Latest Version: 1.2.3

Compatible WordPress Versions:  2.6 to 3.0.3

Updates in version 1.2.3:
1. Bug fixes.
2. Display categories on Edit Pages page.

Updates in version 1.2.2:
1. Do not auto-insert posts if the Page isn’t mapped to any Category. It used to insert all the posts if the Page isn’t mapped to any Category.

Updates in version 1.2.1:
1. Improved compatibility with Menus in WordPress 3. Thanks to Joe

Updates in version 1.2:
1. Compatible with WordPress 3

Updates in version 1.1:
1. Option for auto-insertion of the Pages on Category pages
2. Option for auto-insertion of Posts on the Pages which belong to the same category

Map Categories to Pages displays the category box on the “Edit Page” page. By default, Every page in wordpress is mapped to the default category but this plugin gives the option to select categories for a pages. Read Plugin Update: Assign Categories to Pages – version 1.2, Plugin: Assign Categories to Pages – version 1.1 and Assign Categories to Pages in WordPress for more information.

Be Sociable, Share!

{ 52 comments }

ulric April 15, 2010 at 5:47 pm

Hello,
i have install your plugin on my Wordpress, but hot do you restrict your page to a catergoy ?

i have check one cat but nothing change.

can you help me ?

Amit April 15, 2010 at 10:15 pm

Make sure that you are using the version 1.1. When you are done assigning the pages to categories (just like you do in posts) go to the settings page of the plugins. The settings page provides the options for auto-insertion.

Floriana Fabian November 13, 2010 at 8:57 pm

Thank you for the great plugin! It’s so simple but works great! I’ve been looking for something like this, for almost a year. Is there any way to also insert entire category posts into the page, not only the titles?

susunkordan December 5, 2010 at 6:13 pm

Thanks for the plugin. Its great.
It works when the permanet links are normal, but if i use a permanent link with mod rewrite it doesn´t work. Is there any solution?
Thanks

Amit Verma December 6, 2010 at 10:24 am

It works with wordpress permanent links. But it doesn’t change the permanent links for Pages.

Stephanie Nour December 29, 2010 at 9:28 pm

Hello,

I’m trying your plugin for a page where I only want posts of the ‘Writing’ category to show up. However, the links to posts in that category that eventually show on the page link only link back to the same page. Any insight?

Thanks a lot :)

Amit Verma December 31, 2010 at 6:24 pm

Could you please post the link?

fer December 31, 2010 at 5:52 pm

Great plugin. Thanks a lot.

The Best Homebrew Shops December 31, 2010 at 10:28 pm

I have been using your awesome yet simple plugin on a bunch of my clients WP installs, thanks for doing it!

Amit Verma December 31, 2010 at 10:36 pm

Glad to know that it is useful. Happy New Year

Anna January 9, 2011 at 8:37 pm

Hi Amit,
I have installed your plugin and it’s great, as I am using WP for a normal biz site and do not want to use posts at all. Only problem is that I don’t know how to make the archive with the page categories, when clicking on the category in the footer widget, it goes to the posts archive, which is, of course, empty.
So, I’d like an archive that lists every page by category.
Any ideas?
Thanks for your help.
Anna

Amit Verma January 9, 2011 at 11:38 pm

On Map Categories to Pages setting page, enable Show the Pages on Category pages option. It should start displaying Pages on category archive pages.

Anna January 9, 2011 at 11:43 pm

Excellent, I should have worked that out for myself… it’s been a long day.
Thank you so much for the quick reply.
Have a good one!

Rob January 11, 2011 at 8:54 pm

The plugin is currently correctly showing posts on the pages with the same category, but only the link to the posts. How do I change it to show the whole post or an excerpt of the post?

Thank you, cool plugin.

pat January 11, 2011 at 10:50 pm

Hello,

I am working on a multisite wordpress installation 3.0.4 and have installed your plugin 1.2.2. It is exactly what I need but when I associate a category with a page it shows up on all the pages. What am I doing wrong or is there a fix for that?

Amit Verma January 11, 2011 at 10:59 pm

I haven’t tested it on multisite wordpress installation. I will test it and let you know.

Please confirm that you don’t mean Wordpress MU (Multi User)

pat January 11, 2011 at 11:25 pm

I do mean multisite.

Landon January 13, 2011 at 4:43 am

Hi there. I am using this plugin on a website that’s not live yet, but I have a question related to it. Currently, we are using “Blog” as the static page for all posts and other pages that have the categories of posts go there with no problem. However, I don’t want a page that contains all the posts. Am I missing something that will turn that off?

Amit Verma January 13, 2011 at 3:05 pm

Do you mean you don’t want post to list on Page? If yes, you might have enabled “Show Posts on the Pages tagged under the same category” on Map categories to Pages settings. Turn that off.

pat January 18, 2011 at 7:46 pm

What I would like to do is to only show the categories associated with a page in the sidebar. What is happening now is that all the categories appear in my sidebar whether they are assigned to the page or not. What do I need to do?

Thank you,

Pat

Amit Verma January 18, 2011 at 10:23 pm

doesn’t seems to have a straight forward way to do it. So the workaround is to fetch all the categories and then check whether it contains pages or not. I will look for much better way to list categories associated with pages only. Meanwhile you can use following code.

[sourcecode language="php"]
<?php
$categories=get_categories();
foreach($categories as $category) {
$myposts = get_posts(‘numberposts=-1&category=’.$category->cat_ID.’&post_type=page’);

if(count($myposts)==0){
continue;
}
echo ‘<li><a href="’ . get_category_link( $category->term_id ) . ‘" title="’ . sprintf( __( "View all posts in %s" ), $category->name ) . ‘" ‘ . ‘>’ . $category->name.’</a> </li> ‘;

}
?>
</ul>
[/sourcecode]

Robert January 23, 2011 at 2:47 am

I love your plugin except for one thing. It removes the ability to use post categories. I installed 1.2.1 and 1.2.2 and with the same results. I even resorted to Batch Cat and other plugins in an attempt to be able to assign both pages and posts to categories with out success.

I would love to use your plugin if you can assist me in getting it to work.

Sincerely,

Robert

Amit January 24, 2011 at 3:48 pm

It does work for both pages and posts. This plugin adds the ability to categories Pages and categories for Posts are intact. Which wordpress version are you using?

Robert January 24, 2011 at 10:05 pm

Good Morning Amit, I am using WordPress 3.0.4.

If I deactivate the plugin the post categories return, upon activation they disappear and the page categories are available.

NOTE: I am referring to the editor if that wasn’t clear. When I test for the categories that were assigned to either posts or pages they of course remain.

Thanks for the VERY PROMPT reply!

All The BEST!
-Robert

Robert January 26, 2011 at 10:22 pm

This isn’t an issue about whether the plugin is capable of doing both but rather that it does not on our site. It would be far more product for you to assist me in isolating the cause of the problem that prevents it from work on both posts and pages. Without your assistance in isolating said cause I will be unable to resolve the problem.

Sincerely,
-Robert

Amit Verma January 26, 2011 at 11:25 pm

Please send me the details of your blog/website at amit[at]amit[dot]me and I will look into it.

Tom and Becky - The American Italian Blog! January 28, 2011 at 12:26 am

Good Day Amit,

A most sincere and heartfelt THANK YOU, for your ongoing assistance! Not only do we feel that your support is above and beyond anything we have ever (and we do mean, ever) experienced, but the diligence by which you approach it is truly a breath of fresh air to the “technology” world.

Thank you so very much! We will sing your praises at every opportunity!

Ciao!

Tom and Becky
The American-Italian Blog
“Tom and Becky’s American-Italian Adventure!”
http://www.American-Italian.com

Amit January 28, 2011 at 3:37 pm

Thanks for the appreciation Tom. Wish you good luck for your newly launched blog.

Happy Blogging!!!

Greg February 4, 2011 at 5:59 am

Is there a way to instead of posting just the titles of post on a page, actually display the entire post? Thnx.

Kristian December 7, 2010 at 2:48 am

I can’t find anything on that link that helps with inserting full posts.

Kristian December 7, 2010 at 10:04 pm

Yeah, i didn’t get that to work.

Amit Verma December 7, 2010 at 10:08 pm

send me the page.php file from your theme on amit[at]amit[dot]me

Kristian December 7, 2010 at 10:21 pm

Sent the original, so my mess isn’t in there.

Kristian January 20, 2011 at 5:52 am

I now got this to work. My mistake was not using “defult template” on the pages.

Amit Verma January 3, 2011 at 9:28 am

Thanks for the information. I will check and update the plugin.

Happy New Year :)

Amit Verma January 13, 2011 at 3:16 pm

Could access the page because only members can see it.

Is the page appearing blank completely or just the posts related to the category aren’t appearing? To display posts’ headings, enable “Show Posts on the Pages tagged under the same category” on Map categories to Pages settings page.

Kristian January 24, 2011 at 2:47 pm

Is there a way to show a summary of posts, in stead of the whole post? The “read more”-option in posts don’t work.

Sandor Kiss February 5, 2011 at 6:18 pm

It would be great. I tried to insert it below “Begin the main body” section in page.php, but the whole site got messed up. Where should I place the given code? IN which file, on which section of the php?
Thanks for Your answer. I have no clue.

My wish is to show on the page not only the title link, but the whole posts of that category.

Amit January 24, 2011 at 3:46 pm

Using the settings on Map Categories to Pages setting page, you can insert Post heading on pages.

Kristian January 24, 2011 at 4:12 pm

Yeah, I want a middle-thing of just the header and a full post.

Amit January 24, 2011 at 4:15 pm

Do you mean header with excerpt?

Kristian January 25, 2011 at 6:55 pm

What I am thinking of is the header (with link), an featured image and some text (length of witch chosen when you use the “read more”-button you use when posting posts).

Amit Verma January 25, 2011 at 10:26 pm

You will have to use code similar to following.

[php]
<?php
/* List posts from the same category – start */
global $post;
$cats=array();
foreach(get_the_category() as $category) {
$cats[]=$category->cat_ID;
}
$showposts = -1; // -1 shows all posts
$do_not_show_stickies = 1; // 0 to show stickies
$args=array(
‘category__in’ => $cats,
‘showposts’ => $showposts,
‘caller_get_posts’ => $do_not_show_stickies
);
$my_query = new WP_Query($args);
while ($my_query->have_posts()) : $my_query->the_post();
?>
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<div class="entry">
<!– if you have featured post in custom keys –>
<?php if ( get_post_meta($post->ID, ‘thumb’, true) ) : ?>
<a href="<?php the_permalink() ?>" rel="bookmark">
<img class="thumb" src="<?php echo get_post_meta($post->ID, ‘thumb’, true) ?>" alt="<?php the_title(); ?>" />
</a>
<?php endif; ?>
<?php the_content(‘Read more »’); ?>
</div>
<?php
endwhile;

/* List posts from the same category – end */
?>
[/php]

Kristian January 26, 2011 at 2:07 am

And should I use the code in post.php, in addition too the other codes you have provided? Or replace them?

Amit Verma January 26, 2011 at 11:27 am

The changes will go in page.php (if you want to show posts on pages, which is one of the purposes of the plugin). The code will be replaced.

If you want me to do this, you can send the page.php file to me at amit[at]amit[dot]me.

Kristian January 26, 2011 at 10:46 pm

That gave the title a link, but there is no summary, or read more link.

Amit Verma January 26, 2011 at 11:23 pm

Please send me the theme files at amit[at]amit[dot]me. I will fix this.

Amit Verma February 5, 2011 at 6:26 pm

You should insert it below the mail loop of the page. If you are facing problem doing this, you can send the page.php to me at amit[at]amit[dot]me and I will do it for you.

Sandor Kiss February 6, 2011 at 9:14 pm

You are very great! Thanks, I would like to live with this kind offer.
For the sake of learning: could You put a comment line to the section, You have copied the code? Than I could see, where should I find next time the mail loop.
Actually I have given a search on the page php for “mail” but this word wasn’t present there. the word loop is not there either. Maybe “mail” is “main”? “Main loop?” I could find many lines with the word “main.”

Greg February 9, 2011 at 5:24 am

I’m just gonna put myself out there as a complete dunce, but where exactly do I apply this php code? Is it within the Wordpress interface, or is it external and I have to paste it into a php file via notepad? Thnx again.

Amit Verma February 9, 2011 at 9:17 am

Send me the page.php at amit[at]amit[dot]me and I will do it.

Greg February 11, 2011 at 12:04 pm

So it’s page.php that needs editing? Ok. I’ll do it.

Comments on this entry are closed.