Map Categories to Pages
This website has moved to http://amit.me/wp-plugins
Latest Version: 1.3
Compatible WordPress Versions: 2.6 to 3.1
Updates in version 1.3:
- Widget to display pages from the Page’s category.
Updates in version 1.2.3:
- Bug fixes.
- Display categories on Edit Pages page.
Updates in version 1.2.2:
- 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:
- Improved compatibility with Menus in WordPress 3. Thanks to Joe
Updates in version 1.2:
- Compatible with WordPress 3
Updates in version 1.1:
- Option for auto-insertion of the Pages on Category pages
- 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.
See old comments at http://amit.me/wp-plugins, http://amit.me/plugin-update-assign-categories-to-pages-version-1-2/596 and http://amit.me/assign-categories-to-pages-in-wordpress/545
This website has moved to http://amit.me/wp-plugins

{ 96 comments }
Hia i absolutely love your plugin! it works Great and fairly easy to use.
was just wondering if i could get your help with editing it a little.
i know you already have a guide for editing page.php to insert full post description content onto the page and that works great. but I’m looking to edit the map-categories-to-page.php file in the plugin folder so that i can tick the box in settings and it displays all the content rather then just the title, and without having to edit page.php
does this make sense? its just when i do it, the styling is a little mucked up just not sure why?
would save me time editing the template if wen i install the plugin it already does this.
thanks.
I have already tried it but most of the time it throws memory error when displaying all the fields from Plugin or function.php.
why is that? to many posts under the same category?
i just want something simple for example
orignal =
$content.=’ ‘.$before.get_the_title().$after;
my edit =
$content.=’ ‘.$before.get_the_title().get_the_content(‘Read the rest of this entry »’).’
‘.$after;
which works but makes the styling of text different. something to do with post_class() or get_post_class(), sorry new to wordpress.
Could you please leave the link to the page?
My other issue is that when editing the template page.php
the posts show on every page I don’t assign a category too, is there a way around this? as i dont want to give every page a different category.
This was happening in a previous version. Shouldn’t happen now. Which version are you using? Could you please post the URL of your website?
Version 3.1 . Its just a testing site I’m working on locally with xampp same with the comment above, I could email you? otherwise no worries I’ll just work around it.
thank you for your quick replys.
I mean the plugin’s version. Yes, please email it to me at amit[at]wordpressable[dot]me.
how to show the beggining of every post and not just the links?
thanks
I’d love to know this too. I’ve had a look at http://amit.me/assign-categories-to-pages-in-wordpress/545#template-changes but cannot make head nor tail of it. Step by step instructions would be much appreciated.
step by step would make this so much easier
i use twentyten theme
Sorry for the late reply. I will send you the updated file soon.
Posts are not showing on pages unless logged in, do you know why this might be? and how i could fix it?
If I am right, you had made changes to the plugin file. Could you send the updated file to me?
Hello!
Great plugin, great job! It’s something I was looking for.
But I’ve got some question/request if You mind.
I’m not a PHP coder so forgive me my lame questions. I’m using WP 3.1, Map Categories to Pages v 1.3 and Simpledark Theme and I have no idea how to display part of post on category page (e.g Tech–>Artykuły on my website). It’s only dispalying post titles/headers. Could You give me, please, some advice which file form template modify to display part of post ?
Is it possible to add, in next version, option defining default displaying/behaviour of posts? It would be totally awesome feature.
Sorry for my poor english. Greetings from Poland
Best regards
winnetou
Glad you find it useful.
You can find more information on template editing at http://amit.me/assign-categories-to-pages-in-wordpress/545#template-changes.
I had tried to add that feature in the plugin but on most the wordpress installation it gave memory error.
Let me know if you need further help or you want me to edit the template.
Hi Amit – I’m so excited about this plugin. Unfortunately I’m not much of a .php wiz so I don’t know where I to add the code to page.php. My end goal is to have a few pages with an intro paragraph or two and all of the posts associated for that particular topic listed below. I’d like for there to be a few lines of the post to appear with a link to the full post. Please help!?!
Thanks!
Hi Amit – I’ve gotten the post to appear, but I can’t figure out how to display the blog exerpt and I need some guidance on making the style consistent with my template.
Please refer http://amit.me/assign-categories-to-pages-in-wordpress/545#template-changes for template changes. If you still face problem, send me the files at amit[at]amit[dot]me.
Hi,
I am trying your plugin – it seems to be what I am looking for.
What I would like it to do is this:
1) keep any of the “page” edits I put in at the top – as a static part of the page
2) take the posts I categorize for that page and place them below the static part in its entirety.
Can you help me with the coding for this please?
I am using the latest version of WP
Let me know how much I should donate to your cause for your help.
thanks,
Mike
Sure Mike, could you explain the point 1 a bit more? You can send me the details and theme files on amit[at]amit[dot]me.
Hello Amit!
Thanks for this pugin!
I want to use it to list customfields from post and pages with the category ‘slideshow’.
Now im using this code:
<a href="”>ID, ‘titel’, $single = true); if($titel!== ”) echo $titel;} ?>
ID, ‘tekst’, $single = true); if($tekst!== ”) echo $tekst;} ?>
The problem is that only the posts with the category ‘slideshow’ are listed. Can you help me with this?
Thanks..
Eelco
Sure Eelco, Could you please post the whole code you are using to achieve this? Want to know how you are querying posts.
Hello Amit,
Sorry I made a mistake, here it is:
query_posts(‘category_name=slideshow&showposts=10′);
while (have_posts()) : the_post();
a href=”php the_permalink() “>php { $titel= get_post_meta ($post->ID, ‘titel’, $single = true); if($titel!== ”) echo $titel;}
php { $tekst= get_post_meta ($post->ID, ‘tekst’, $single = true); if($tekst!== ”) echo $tekst;}
php endwhile;
wp_reset_query();
This code will show posts from the category “slideshow” because you are querying post from this category only.
Could you please tell me more about what output are you intending?
hi
I have installed Map Categories to Pages. it is working fine. But it display only link of posts in page. Please guide me how to display full post like Post title, post content etc in page.
Thanks
Please checkout http://amit.me/assign-categories-to-pages-in-wordpress/545#template-changes.
Thanks Amit
it working now.
Greetings,
I am having issues with your plugin. I have installed it and have used it until the other day when Wordpress was upgraded. Now everytime I try and search through my pages using the Category search on the Pages section of the backend of my WP installation.
This is the error I get:
Warning: Illegal offset type in isset or empty in /home/abc123/public_html/wordpress/wp-includes/post.php on line 811
See attachment for screenshot of the error.
Also, once that error comes up, once I try and go to a different category on the same screen I get a white screen with this error:
Invalid post type
Any help you can offer to rectify this issue would be greatly appreciated. It does not seem to affect the website itself so I will keep working on the site for my client until I hear from you. Thank you very much!
In Christ,
Juvenaly Martinka
Could you please post the link of the problem site?
Hi, Amit – I installed the plugin, made template changes, and the posts are showing appropriately. The only issue is that the actual Page link (with the date underneath) is showing at the top of the list of posts. Is there any way to get this to not show up? I’d like only the static title of the page at the top, followed by the list of actual posts.
Thank you for writing such a helpful plugin!
All the best,
-
Jack
If I am not mistaken, you want to remove the page title. If so, you will have to remove some code from the page template. The code should look similar to following. I have taken this example from the Wordpress default theme twentyten.
[php]
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( ‘Permalink to %s’, ‘twentyten’ ), the_title_attribute( ‘echo=0′ ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
[/php]
Amit — Thanks so much for this. Very awesome.
Glad you liked it
Hi Amit,
I’m having some trouble implementing Categories-to-Pages plugin on a live site. Works fine on my test site, but I can’t tell for the life of me why it’s not working on the live one.
It’s been many months since I setup the test site, so it’s probably something I forgot to replicate on the live version (the test site could not be directly synced with the live one which is why I’m manually rebuilding). Anyway, here’s what’s happening:. I’m using Tweet Import to bring in some Twitter posts. Those are being mapped to a specific categories and through your plugin to a specific page. All is fine and dandy until you click on the page and select one of the posts. When you do that you get a “Not Found” error. The posts show and view find on the homepage and on the category view, just not as pages. Any ideas?
Hi again. Call off the hounds! I figured it out. Just a simple screw-up with my permalink settings. It was right in front of me but I didn’t see it.
Follow-up question: To display more than just the post title on a page, is it still necessary to edit the template? http://amit.me/assign-categories-to-pages-in-wordpress/545#template-changes)
Yeah, you will have to make the template changes.
Hi Amit:
I have high hopes for integrating your plugin into my website, but I’m afraid my php isn’t good enough to finish the job.
Essentially, I can’t figure out how to have a specific page list the full content of posts of a particular category:
a) not just a link to the post, but the full post
b) without messing up all the other pages on my website.
I’d like to do this on several pages (i.e. have a ‘fruit’ page that lists all my ‘fruit’ posts and have a ‘vegetable’ page that lists all my ‘vegetable’ posts).
Any help you can give me would be gratefully received.
Thank you:
Ria
There is a tutorial at http://amit.me/assign-categories-to-pages-in-wordpress/545#template-changes.
If you want me to this then please contact me at amit@amit.me.
Is there any way to Map Categories to Custom Post Types?
I’d like to map existing Categories to Custom Post Types so the CPT can be viewed using Archives, and various sliders and Category widgets. Any suggestions?
Thanks,
Jeff
I think you will have to enable Custom Post type to use categories. It should do the trick.
I’m excited about this plug-in but I’m having trouble with a very simple implementation (I am somewhat new to WordPress). In my page.php file I have added some test code:
echo ‘CATID: ‘ . get_query_var(‘cat’);
I have assigned categories to my page, but when I view the page the variable comes back empty. I
The Pages don’t have “cat” parameter in query string. You will have to fetch the category from global $post variable.
Use following code to print categories:
global $post;
foreach(get_the_category() as $category) {
echo $category->cat_ID;
}
That worked, thanks!
Hello AMit,
You plugin is great! I just need some clarification on how to modify the the page.php file to get the full posts to show. Do I replace what’s there? I am using the twenty eleven theme v 1.2
Thanks in advance for your help,
Steeve
I have customized and uploaded content-page.php at http://wordpressable.me/wp-content/uploads/2011/09/content-page.php-twentyeleven.zip. You might want to tweak the CSS or placement of the code.
The custom code is surrounded by “List posts from the same categories” comment. Don’t forget to take the backup before you replace the file.
Amit,
Thanks for the help. One last thing, the images from the posts are not showing is it possible to have them there?
Thanks again,
Steeve
Oh yeah, can I also remove the list of posts from the page without losing other content lika a calendar?
Gracias,
Steeve
Fixed the list of posts, it was being caused by the sharethis plugin. Still interested in showing the images. does it have something to do with showing the entry summary and not the full entry?
Steeve
I have made the changes to display post thumbnail and uploaded the file at http://wordpressable.me/wp-content/uploads/2011/09/content-page.php-twentyeleven.zip. I have used the_post_thumbnail() function to display the thumbnail.
If you want to change the size of the thumbnail, please take a look at http://codex.wordpress.org/Post_Thumbnails.
Installed your plugin, dropped in this code -
function add_category_box_on_page(){
//add meta box
add_meta_box(‘categorydiv’, __(‘Categories’), ‘post_categories_meta_box’, ‘page’, ‘side’, ‘low’);
}
add_action(‘admin_menu’, ‘add_category_box_on_page’);
- to my theme’s (twentyten) functions.php file which gave me this error -
Fatal error: Cannot redeclare add_category_box_on_page() (previously declared in /home/content/d/s/i/dsignorelli/html/main/wp-content/plugins/map-categories-to-pages/map-categories-to-pages.php:28) in /home/content/d/s/i/dsignorelli/html/main/wp-content/themes/twentyten/functions.php on line 544
- Then I took the code out and updated my functions.php file, which brought me to the same error. Now my whole site is down and my functions.php ONLY HAS 540 lines of code.
Thoughts?
The issue was solved. No Worries~
Hey Amit,
Thanks for all of your help! Does this plugin work with the WPtouch plugin foe viewing on mobile devices?
Just wondering,
Steeve
Never tried it. Will check and let you know.
Hi Amit,
I have the list of pages in a category displayed in the widget, but when I go to each page, the url shows the right page but the contents and page title are always the same page, no matter what the url shows, and what link you click on.
Check out the issue here http://sage.unleadeddevelopment.com/consulting-expert-witness-services
Thanks,
Scott
Please send me the theme files where you have made the changes at amit@amit.me
Hi,
I have a multi blog/page site. I like the idea of the plugin but I don’t know if it is the right one for my site. I want to be able to separate pages/blogs (ie football blog vs basketball blog). Although I try to separate them by using the plugin, for example assign the basketball page to a basketball category and football to football, if I make a post to one, that post still will show up on both despite the fact that neither page has the other’s category assigned to it using the plugin. Have any idea as to why? Does the plugin not work for multiple blog pages on the same site?
I think this is the right plugin for your problem. Make sure that you haven’t selected both the categories for the posts as well.
How are you displaying the posts on the pages? Have you customized page templates or are you using auto insertion?
Thanks for getting back to me Amit. Currently I’m using auto insertion. I’m a programmer coming from the .net world and my php knowledge is very novice. I only am selecting one category per page, for instance baseball ONLY has the category baseball selected, as I only want baseball posts to go on the baseball page and not the basketball page as well.
Any hints you got I’ll take…and donate…when it works
.
Are you using the latest version? Would you be able to give me access to the admin area, so that I can check the settings?
Email me at amit@amit.me
Hello Everyone!
I was wondering if anyone could help me! I recently moved my Wordpress Blog from one Host to another but it seemed like the transfer went well until I was navigating through my site and tried to click on the link at the bottom of the page that takes you to Older Posts and instead it took me to Page 1. I looked around and found a bunch of ideas but what I am curious is why did this happen after moving the site? It didnt happen on the older host. If anyone has any ideas on how to fix this issue please let me know.
Thanks,
Semper Fidelis,
Manuel Perez
It seems fine to me. When I clicked on Older Entries, it took me to the Page 2 which seems normal.
Yeah,
I uninstalled the iNove Theme and reinstalled it! Now I have to recustomize it with my changes that I had before.
Thanks,
Manuel
Hello Amit,
First of all, great plugin you have here!
But, I’m having issues when trying to set the code on the page template, as it showing on the end of the page, and on a completly different layout of the current posts.
Can you help me out?
Best Regards,
Valter Gomes
Could you please share the URL and your code?
I’ve managed to work it out in other way, I’ve assigned different services as a Portfolio type, and the pages allow me to show different portfolios, so I could work it like that.
Many thanks anyways Amit!
Question-
Can it work to map to subcategories also? I see the category box on my edit page screen, but it doesn’t show sub categories, only parent categories?
Thanks
Laura
It does. It gives you exactly the same Category box as you have on Posts. Could you please send a screenshot Category box from Page and Post edit screen?
Hi Amit,
I’ve been trying for a while to get your plugin in work for me, but I just couldn’t. Mainly, I wanted to use your plugin so that when I click on a category (listed via the default wordpress category widget), all the pages in that category would load. Wordpress would recognize that I had assigned those pages to those categories, but it wouldn’t display them.
So instead, I deactivated the plugin and used the code on your old page to insert the category box in functions.php, and I used the “displaying pages on category pages” code in functions.php as well. This worked great!
Until….I found that I couldn’t change my page’s categories. I would uncheck the box, update the page, and it would come back with the box still checked, as if I had changed nothing. I even tried Frankinsteining some of the new code (the function mcp_init() down to the end of function page_categories_metabox()) from the plugin to see if maybe the old code was too old to handle what I was doing, but when I replaced it, the category box just disappeared, but it seemed like the pages were still mapped to the categories.
I was wondering if I could get your help with this. What am I doing wrong?
Thank you so much. I really appreciate it!
You just need to
1) install the plugin
2) assign Pages to categories
3) enable “Show the Pages on Category pages” options from the plugin’s options page
It should then display the headings of the pages on category pages.
Let me know if you find any problem.
Thanks! I totally missed the “Show the Pages on Category pages” option. Works great!
Okay, I’m totally confused so obviously I’m new to all this.
Where do I find the “Show the Pages on Category pages” or the plugin’s options page?
I’m trying to show all the posts from one category on a specific page. Am I even using the correct plug-in?
Thank you and Happy New Year!
Happy New Year!
You need to tag the Page with the same categories as of the posts which you want to display on that page.
There is a setting to display Posts on pages on the options page. You can find that under Settings -> Map Categories to Pages.
Hi, I’ve installed the plugin and want to display the category names on the main page of a site. I have pages of various artists and each artist is a category and each artist has a number of paintings. I have custom fields set up for painting titles and have assigned the artist name category to their various pages. What I would like to do is to find a way for all artist names to appear on an index page in alphabetical order, preferably by alphabetical title like ABC etc. I don’t know if this is possible. Thanks
derek
If you are using this plugin, I am assuming that you are tagging Pages with the categories and want to display Pages on homepage rather than the categories.
If you want to display all those pages in sidebar then use Pages or Custom Menu widget.
Thanks, I want to display them on the page not in the sidebar. I would like to have them show all the artists which are now categories as individual links to other pages but on a central page rather than on the side.
Thanks
You can use http://codex.wordpress.org/Template_Tags/wp_list_categories function to display Categories in template file.
Hi Amit,
As many others in this thread I am completely new to this.
I have successfully installed your plug-in and can see lists of the posts on each Category page. I would like however to show the full posts on the pages.
I am using the twentyten theme.
I would be truly grateful if you could give me an “Idots Guide” on how to achieve this.
Thanks again for a great plug-in and all your efforts to help us.
You can download it from http://wordpressable.me/wp-content/uploads/2011/09/content-page.php-twentyeleven.zip
Oh sorry you want it for Twenty Ten. I will customize Twenty Ten theme file and will post a link.
Hi Amit,
Sorry for getting back to so late. I was in Africa on Business with no Internet.
Thanks again for your help. Did you get chance to customize the Twenty Ten Template?
Ray
You can download the files from http://wordpressable.me/wp-content/uploads/2012/04/template-changes-twentyten.zip. It has two files. Place them either in twenty ten folder or in child theme folder of twentyten.
Thanks Amit,
Do I need to do naything else apart from putting the files in the Folder?
sorry but i am completely new at this.
Thanks Amit
Do I only have to copy the Files to the relevant folder or is there something else I need to do?
Yes, you just have to put these files in the theme directory.
What part of the code do I need to edit?
<div id="post-” >
<a href="” rel=”bookmark”>
<?php wp_link_pages('before=&after=&next_or_number=number&pagelink=page %’); ?>
Sorry, no pages matched your criteria.
<div id="post-” >
<a href="” rel=”bookmark”>
<?php wp_link_pages('before=&after=&next_or_number=number&pagelink=page %’); ?>
Sorry, no pages matched your criteria.
K I can’t post my coding, I am using the liquorice theme and have no idea what I need to change in the template to display the whole post.
You need to insert the code given at http://amit.me/assign-categories-to-pages-in-wordpress/545#template-changes just after the loop ends.
If still not sure what to do then send me the theme files on amit[at]amit[dot]me
Brilliant,
Thanks again for all your support and help Amit
First i have to say that this is a great plugin! Have a couple of questions ( as if you never heard that before).
I hard coded your hard work and the code is working great. one other feature that i need it to be able to sorts posts in a certian catagory. i have used Q2W3 post order and it does the job, however your feature seems to override the ability to sort and i wondered if you had any thoughts on the matter.
Hey there!
I recently installed your plugin into my blog. Well, the reason I was wanting it is so that I could automate the tasks of having my child pages listed inside the parent page using the plugin “Cat2Page”.
Doesn’t seem like it’s working, was hoping I could get some help in fixing the issue or if you know what’s going on? It’s assigning categories like it’s supposed to, it’s just not showing the listings from the “Cat2Page” plugin!
Thanks,
Matthew Roe
If you want to display child pages of current page use example given at http://codex.wordpress.org/Function_Reference/get_page_children#Examples.
Let me know if you need my help.
Hi,
I am having an issue with the plug-in. When I add this code:
//call a function just before the query runs to fetch posts
add_action(‘pre_get_posts’,'change_post_type’);
function change_post_type($var) {
if(is_category()) {
$var->query_vars['post_type'] = ‘any’;
//it will change the value to ‘any’ from the default value of ;post’;
//can be any, attachment, page, post, or revision.
//’any’ retrieves any type except revisions.
}
}
to functions.php in my theme I get this on my site:
Fatal error: Cannot redeclare change_post_type() (previously declared in /home/asecre5/public_html/here/wp-content/plugins/map-categories-to-pages/map-categories-to-pages.php:72) in /home/asecre5/public_html/here/wp-content/themes/pagelines/functions.php on line 33
As I am sure you have guess I am totally clueless on this stuff and I apologize if this question is addressed somewhere else. Thank you.
I have already used function name change_post_type in the plugin. Just change the name of the function and it will work.
This website has moved to http://amit.me/wp-plugins
Comments on this entry are closed.
{ 1 trackback }