restricting access to questions and answers to just members

I'm using cart66 so people can purchase digital downloads and sign up as a member on my website. I would like to offer the Q&A to just those members who purchase my product. I can't see a way to do this though because the Q&A plugin uses custom post types, and so there's no physical page where I can wrap the plugin around with a shortcode. The cart66 plugin gives me the option to use a member level that I can define such as "basic".

[show_to level="basic"]content[/show_to]

  • Steven
    • Site Builder, Child of Zeus

    Thanks Barry, I saw the Q&A settings, but unfortunately it doesn't look like it assigns them a WP role. I'm just in the process of posting a topic on their forums, asking if I can assign a WP role to purchasers but I have a feeling this isn't going to be possible.Looks like the plugin keeps the users completely separate from WP.

  • Steven
    • Site Builder, Child of Zeus

    I've ditched the shopping cart and am now using Gravity forms. A few questions:

    1. I'm restricting access to the Q&A under settings, but even if I'm logged out, I can still see the questions, post new ones etc. Might be something on my end though but I can't think of anything.

    2. I'm using the Genesis framework and have my default page template set to full width but on these /questions pages I can see the primary sidebar. How can I edit it so it's full width?

    3. The permissions doesn't seem to be working as per (1) above so I can't test this, but that drop down menu on the settings page... does that allow you to set permissions for each role? not just one? I have more than one WP role that I would like to restrict access to the q&a for.

  • Mason
    • DEV MAN’s Sidekick

    Hiya Andrew,

    1. I'm restricting access to the Q&A under settings, but even if I'm logged out, I can still see the questions, post new ones etc. Might be something on my end though but I can't think of anything.

    As these are custom post types - you definitely shouldn't be able to post without being logged in. The page is visible - but they can't post until they are actually registered/logged in. You could add a check for is_user_logged_In in the plugin's templates and have them only display for members. Here's a tutorial:
    http://buddydress.com/2010/05/logged-in-and-logged-out-content-tutorial/

    2. I'm using the Genesis framework and have my default page template set to full width but on these /questions pages I can see the primary sidebar. How can I edit it so it's full width?

    I've been helping a few folks fit things into the genesis sidebar page here:
    https://premium.wpmudev.org/forums/topic/qa-plugin-style-issues-in-single-questionanswer-area

    Basically, you can add some extra theme styles to fit the sidebar in - otherwise you'll want to remove the calls to sidebar.php from the plugin's template pages (located in qa/default-templates/)

    does that allow you to set permissions for each role? not just one? I have more than one WP role that I would like to restrict access to the q&a for.

    I'm pretty sure it allows you to dictate a setting for each role that is listed. I'll ask the developer to confirm.

    Hope this helps! Thanks!

  • scribu
    • Site Builder, Child of Zeus

    As these are custom post types - you definitely shouldn't be able to post without being logged in.

    Actually, you can post annonymously and then are prompted to log in. This is a feature.

    Although, I guess I should add an option to make the whole Q&A section private.

    does that allow you to set permissions for each role? not just one?

    Yes, all roles are configurable.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.