WordPress.org

Ready to get started?Download WordPress

Forums

How to limit author to a specific category? (52 posts)

  1. htad
    Member
    Posted 8 years ago #

    Is there any hack / plugin to limit the author to just be able to post only in specific category ?
    Ex:
    Author A => only able to post in Category A
    Author B => only able to post in Category A

    I've looked around .. and can't find anything.

  2. brantz88
    Member
    Posted 8 years ago #

    I'm in the same boat. I'm setting up WordPress for the College so that the departments can post events and news.

    I setup categories for each department with a subcategory of events and news.

    1. I'd like to create users that can publish only to their department categories - how can I do this?

    2. I'd like to create RSS icon so that readers can subscribe to RSS feed for just the department category they wish and not the entire site.
    When I subscribe with Feedreader I get all the posts so don't know how to get RSS for just 1 category.

    3. I'd like to create a webpage off of wordpress on our college site that will show the most recent event and news from each department. Is there some sample code for this?

    Thanks in advance - I'll keep searching but any assistance would be greatly appreciated. I've been searching for a day and most of my leads are deadends.

    Thanks again,
    Doug

  3. moshu
    Member
    Posted 8 years ago #

    @htad,
    Have you had a chance to look around in the Plugins/Restriction section of the Codex? Look for Limit_Categories.

  4. moshu
    Member
    Posted 8 years ago #

    @brantz88,
    1. See above.
    2. WP automatically creates feeds for categories. Just read about the list_cats and wp_list_cats template tags: Template_Tags#Category_tags
    3. You will have to use a feedreader and put the feeds into it. (search for "feedreader" around here)

  5. htad
    Member
    Posted 8 years ago #

    Thanks moshu. Limit_Categories doesn't work for me, it won't let the author post at all. I'm trying to contact the author of that plugin.
    Is there another way / plugin to do this ?

  6. brantz88
    Member
    Posted 8 years ago #

    Moshu - thanks, I have downloaded the plugin for limitcat and looked it over. I have 8 departments so I will need to see if this plugin will allow this. Also, it says it is written for 1.5 but I'm using 2.0.2. I'm not the best at php but I'm not sure if this will work. Is it possible to add new roles to the user in wordpress. For example, ART Publisher and that will only allow them to publish to ART category and ART subcategories? In the limitcat code it looks like you have to limit it by levels and v2.0.2 of wordpress uses roles. I also don't remember how many levels there are (8) I think - but I have 8 departments. Can you offer any suggestions and do you think the limitcat.php plugin is the way to go or should I email the plugin creator?

    Thanks again for the quick response.

    Doug

  7. moshu
    Member
    Posted 8 years ago #

    I am using it on WP 2.0.2 together with the Role Manager and it works perfectly.
    http://redalt.com/wiki/Role+Manager
    With the Role Manager you can create unlimited new roles + set the capabilities for each role.

  8. brantz88
    Member
    Posted 8 years ago #

    Moshu - Thanks for all the quick responses.

    I've downloaded Role Manager and I'm looking at it now.
    Here is my plan. Create a Role for each department. For example, ART - I'll allow them to Edit Posts, Publish Posts, Read and Upload Files (images). Hoping that is correct for that user to post and edit their posts etc. This gives the user a level of 0. Now if all the department users have different Role names but the same level of 0 how can I alter the code in Limitcat to allow ART to access only the ART category and subcategories? Can I base it on Role name and not level? Or should I add a new capability when creating roles.

    Thanks again - I feel like I'm actually getting something done today with your help of course.

  9. moshu
    Member
    Posted 8 years ago #

    LimitCat also has an admin panel under Options. There you can set the categories a Role is permitted to post.

  10. brantz88
    Member
    Posted 8 years ago #

    I've looked under Options and don't see a admin panel for LimitCat. I'm using v. 1.1 of limitcat. Do I click under Options and then I see General, Writing, Reading, Discussion, Permalinks, Miscellaneous. Am I looking in the wrong place. This would be the answer I've been looking for. Do I need to logout? Or deactivate then activate the limitcat plugin?

    Doug

  11. brantz88
    Member
    Posted 8 years ago #

    Also - I have not edited the limitcat plugin - do I need to add the categories in the code or should it find them?

    Thanks,
    Doug

  12. moshu
    Member
    Posted 8 years ago #

    Mine is version 1.5.2!
    Maybe that's the problem. Try to download from here: http://www.redalt.com/downloads/

  13. brantz88
    Member
    Posted 8 years ago #

    Here is the link on that page?
    Download 1.1 Here <–Latest ??
    Any Ideas?

  14. moshu
    Member
    Posted 8 years ago #

    Sorry, I knew I got it somewhere on that site...
    here you go:
    http://redalt.com/wiki/Limit+Categories

  15. brantz88
    Member
    Posted 8 years ago #

    Awsome! I can't thank you enough! Part 1 solved.

    Now, for part 2 of my quest. Adding the little RSS icons on the categories so readers can subscribe to just the category(ies) of their choice.

    Is this easy to do? list_cats and wp_list_cats template tags. I'll try the link you sent earlier.

    Thanks again,
    Doug

  16. brantz88
    Member
    Posted 8 years ago #

    It looks like the RSS feature of all the categories is already built in with all these templates - if I'm reading all this correctly?

    When I click on a category from the category menu on the right, Art Events, it goes to Archive for the 'ART Events' Category and lists the events - but is it possible to have a RSS icon at the beginning of the title or under the post next to Posted In or should it be at the top? When they click on the RSS link it will subscribe them to ART Events and nothing else. I just don't know if there is a place to switch on this type of option. Do I find an RSS image and add it to the image directory and then edit a template and add some code? I feel like I'm making this more complicated than it is.

    Doug

  17. moshu
    Member
    Posted 8 years ago #

    Yes, you do :)
    Just read carefully the list of the parameters for the template tag that is used for displaying the categories in the sidebar (Link above).
    An implementation without image - see by clicking on my name.
    For image: you need to upload your image and put the path to it in the template tag.

  18. brantz88
    Member
    Posted 8 years ago #

    Ok - I'll read up on parameters. It looks like you use both text and images on the side bar on the left side of your site. So, all I need to do is edit the template - but which one? I'm looking at the wp_list_cats & list_cats tags. So are these the tags I need to edit in something like sidebar.php from the wordpress default theme files?

  19. brantz88
    Member
    Posted 8 years ago #

    Maybe I use this line?
    <?php wp_list_cats('sort_column=name&optioncount=0&feed=RSS'); ?>

    I notice that feed=RSS is not in the orginal file in sidebar.php from wp-content > themes > default

    Also - if this is correct then where do I put a link to the image within this template so it shows up?

    Thanks,
    Doug

  20. brantz88
    Member
    Posted 8 years ago #

    I tried the above but didn't notice anything.

    I'd like to have a link with each category so that it would be like (feed:http://server/wordpress/?cat=16&feed=RSS) but I don't think that will work.

    Can you tell I'm lost - like on an Island with the Others.

  21. brantz88
    Member
    Posted 8 years ago #

    Ok - let me know if this will work.
    Go to sidebar.php and edit the file listing category and add &Feed=RSS.
    <?php wp_list_cats('sort_column=name&optioncount=0&Feed=RSS'); ?>

    But then add the path for the image after that?
    so it would be ..Feed=RSS')Path/filename; ?>

    or do I use feed_image in the string?

    feed_image
    (string) Path/filename for a graphic to act as a link to each Categories' RSS2 feed. Overrides the feed parameter.

  22. htad
    Member
    Posted 8 years ago #

    Hey guys,
    I'm sorry. I installed the plugins called Category Access not Limit Category.
    It locates here: http://www.coppit.org/code/index.php

    But, it's not working for me. I'll try Limit Category + Role Manager tonight and let you know if it works.

    Thank you moshu :)

    P.S: brantz88, did you get it to work ?

  23. brantz88
    Member
    Posted 8 years ago #

    htad - Yes its awesome! I installed both the Role Manager and the LimitCat and they work great. As Admin go under Users and then Roles and Role manager allows you to create new roles and then you can go to Options and under Limit Cats you can select the categories allowed for each Role. I've set it up but have not actually tested it. So, I should say the setup of everything works. I'll test it soon. Make sure you get the 1.52 version of limitcat plugin the 1.1 didn't work for me.

  24. moshu
    Member
    Posted 8 years ago #

    I was out of the house...
    If you have an image, let's say called "feed.png" and you put it in your themes's image directory, then you can use something like:
    <?php wp_list_cats('sort_column=name&sort_order=desc&feed_image=wp-content/themes/your-theme-name/images/feed.png'); ?>

  25. htad
    Member
    Posted 8 years ago #

    Hey guys,
    http://redalt.com/ .. is down :(
    Can somebody please email me LimitCats 1.5.2 ?
    It's uttvoice@gmail.com
    Thanks

  26. moshu
    Member
    Posted 8 years ago #

    It works for me - I mean redalt.

  27. brantz88
    Member
    Posted 8 years ago #

    The website worked for me too.

  28. brantz88
    Member
    Posted 8 years ago #

  29. brantz88
    Member
    Posted 8 years ago #

    Moshu - I'm confused what file to edit. I tried changing the line in sidebar.php in wp-content > themes > default but I don't see any changes on my site?

    Is there a file under wordpress I need to edit?

    Thanks,
    Doug

  30. moshu
    Member
    Posted 8 years ago #

    Nope, that's what you should edit: sidebar.php of your active theme.
    (but I don't touch the default, sorry...)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags