I want to add follow category button so user can subscribe to category , and create a page with view which only shows post from categories the user follow
Hi, there's nothing exactly like this built-in to Toolset. You could create something like this with custom fields, a View filtered by term, an Edit User Form, and some custom code. It's a rather complex setup. Here's the general idea:
- Create a repeating text field on User profiles. This field will hold the slugs of each term followed by the User.
- Create an Edit User Form that includes a generic hidden field. Set the value of the hidden field to be the slug of the term you wish to follow. Remove the other visible inputs.
- Use conditional HTML to test the current User's custom field value. Show or hide the Edit User Form depending on whether or not the User's repeating field contains the term. If the User follows the term, hide the Form. If the User does not follow the term, show the Form. I can show you some examples if you need help with this.
- Use the Forms API hook cred_save_data to update the User's custom field values when the User submits the Form. I can show you some examples if you need help with this.
- Create a View of posts, filtered by term slug, where the slug is set by a Views shortcode attribute.
- Pass the custom field value for the current User into the View shortcode.
- In the View results, build the design for displaying matching posts.
My issue is resolved now. Thank you!