Support » Plugin: Subscribe2 » How to add a subscribe button on ad listing page

  • Resolved Manish


    I am using custom post type ad_listings to display classified ads that users post. I have read FAQ and implemented the custom_post_type and custom_taxonomy code in functions.php
    I need an option to subscribe users to the custom category they are posting the ad in. How can this be done.

Viewing 9 replies - 1 through 9 (of 9 total)
  • @nims,

    I’m sorry, I don’t understand your question.

    “I need an option to subscribe users to the custom category they are posting the ad in.”

    So who makes the post? A post is made by a single account normally. Are you talking about people who follow up with a comment?

    I am using a theme for posting classified ads. I have category cars and sub-categories as car makers. Now if some user wants to post an ad under cars->Honda I need this user to be able to subscribe to this sub-category Honda. This would enable him to get updates regarding other ads posted in this sub category.


    Okay, I think I understand, so the user who posts the ad under Cars->Honda is a registered user with a WordPress user account, they can add the subscription in their Subscribe2 profile.

    There isn’t a way to have this done automatically without some very site specific custom code. You could add a link through to their profile perhaps but is seems that this would need to be done on the advert authoring page.

    I know I need to customize the theme files a bit. I will try to edit the ad-posting file of the theme to add a checkbox to subscribe that category. Just wanted to know what code needs to be put that would subscribe him to that particular category.

    The problem is that this theme uses front end posting, so I don’t think the user will see subscribe options page as the backend access is disabled. FYI I am using classipress, if that helps.


    You’ll need to find a way to identify the category ID and then add it to the list as stored in the usermeta table for that particular user ID.

    Have a look at the code in the admin/your_subscriptions.php file to see the usermeta keys you’ll need to update (s2_cat{#ID} and s2_subscribed).

    or if you could tell me how can I add a button on category pages so that registered logged-in users can click to subscribe that category.


    It’s going to be the same type of fix as described above, code your button and tie the input to a PHP function script that takes the category ID and the user ID and then updates the usermeta table keys listed above.

    Can you help in providing the code. Its bit confusing.
    How does it work at the moment in normal case ?


    The code you need will be an adaption of the form processing in the admin/your_subscriptions.php file.

    Sadly, I don’t have enough time to dedicate to solving individual site issues. If you are stuck consider asking for assistance on WP Jobs.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to add a subscribe button on ad listing page’ is closed to new replies.