WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Categories? (8 posts)

  1. Anonymous
    Unregistered
    Posted 10 years ago #

    I'd like to have readers able to select multiple categories. So if I have:
    Bicycling
    Books
    Everything
    Food
    General
    Movies
    Politics
    Religion
    a visitor and view only the categories of interest and get all of them at the same time.
    To be really useful making this persistant would be nice. But just the option of multiple categories would be good.

  2. NuclearMoose
    Member
    Posted 10 years ago #

    Just so I understand, you are asking if it could be set up so a reader could pick their X number of favourite categories, and only see the content from those? Then you would like to have a cookie written so that on their return visit, their choices would be set already?
    Interesting! I'm sure a dev will have a look at this at some point. Thanks for your idea!

  3. mikeraz
    Member
    Posted 10 years ago #

    Yup, that's exactly what I had in mind. Someone may care about the restaurant's I've commented on, what bike rides are going on, but be repulsed by my politics.

  4. Lilandra
    Member
    Posted 10 years ago #

    are your politics that bad?

  5. unteins
    Member
    Posted 10 years ago #

    A better way to do this would be to save the data in the database. This would require a change to the wp_users table to add a Category lookup ID and another table called something like wp_user2cat with the same structure as the wp_post2cat table.
    Doing it in the db is much nicer for the user since they don't have to reselect the categories anytime they log in from a new computer. Plus it puts data in the hands of the blogger to figure out what topics people are reading and which they aren't.
    There are code changes you'd have to make as well. You would need to add a category function to the user data and then find a way to filter the posts using that. You probably would also want an option to filter by default and have a link to all posts or if that was off then you would get all posts by default and then a link to see just the categories the user is interested in.

  6. guboogi
    Member
    Posted 9 years ago #

    This topic is pretty old, but this is exactly what I had in mind for my site. I would like to create multiple categories and I know that everyone isn't interested in all of them (namely the sports that I like to write about).

    I was thinking of having a list of my categories on the right sidebar with a checkbox next to them. By default they would be all checked, but a user can uncheck them as s/he pleases. A cookie would be stored on the local computer so that these category selections would be saved for the next visit. A checkbox form like this should suffice:

    Music [ x ]
    Web [ ]
    Sports [ x ]
    Games [ ]

    If "music" and "sports" were selected, once the user hits "submit" on the form it would take them to http://www.website.com/index.php?cat=1+3. (assuming they were categories 1 and 3 respectively)

    Unfortunately, while this form doesn't seem like it would be too difficult to make, I'm not especially savvy in these kinds of things. I know even less about incorporating cookies. Can anyone please help or lead me in a better direction? Thanks in advance.

    (Also, unless I'm misunderstanding the post above that suggests solving this within the database, wouldn't that require users to register before their settings can be saved? I don't have visitors register, so this would not work for me.)

  7. berlinde
    Member
    Posted 7 years ago #

    i'd also want to do something along these lines with my blog, but unfortunatly i'm not php-savvy enough to pull it off, nor is my google-fu being productive. can anyone shed some light on how something like this might be done?
    it'd be greatly apreciated.

  8. berlinde
    Member
    Posted 7 years ago #

    anyone? i'm really hitting a wall here..

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.