lundi 2 mars 2015

Allow a user to 'subscribe' to different post categories?


Is there a way for me to have a tickbox on a category archive page that when ticked shows that category's posts on a separate page?


I'm working on a system for my work where each user will be able to 'subscribe' to a category of post and then on a 'my list' page shows posts from the categories the categories they have ticked.


I've come across a couple of posts that are close to this but with no real answer.


One suggestion was to use add_meta_data/update_meta_data which I have just had a look at. I got it so that custom meta data was added, but to change it I could only overwrite. What I was thinking was that when the a tickbox is ticked, it adds the category id to a list of other category ids and unchecked removes the id. Ideally I think it would be best if it was one field/column which stores category ids, separated by commas, that could just be pulled in to a wp_query. If there is a way of doing that then I would be fine to sort out the rest of it.


So the user process would be:



  1. Go to category page

  2. Click tick box to add or remove category

  3. Go to 'my list' page to view posts from ticked categories


I hope that is clear enough, any help would be much appreciated (even just a nudge in the right direction). Thanks.


EDIT: Apologies, apparently I wasn't clear enough. This is not a mailing system.


I'll try and explain it better.


Post 01 has category A

Post 02 has category B

Post 03 has category A

Post 04 has category C


On the category archive page for category A, Post 01 and Post 03 are displayed. In the sidebar is a tickbox that when clicked 'subscribes' them to that category. (I'm using subscribe as a general way to describe the behaviour, not as a specific term)


For this example, let's say the user has clicked the tickbox for categories A and C.


On a separate page ('My List'), the posts from all the categories a user has 'subscribed' to are displayed. In this case, that would be Post 01, Post 03 and Post 04.





Aucun commentaire:

Enregistrer un commentaire