• Resolved cxp4

    (@cxp4)


    Hi,
    I use oxygen builder and created a template with it to display custom fields added to a cpt.
    When I go to the url of one cpt item, the content (custom fields) displays, even though I have associated a product to be purchased in order to display the content.
    Does this only work with default wp template?

Viewing 1 replies (of 1 total)
  • Thread Starter cxp4

    (@cxp4)

    I was helped by Robert in the oxygen facebook group. Here is the solution:

    I'd just wrap it around some functions so in code snippets or similar create the 2 functions:
    function chris_ppp_has_access() {
    return Woocommerce_Pay_Per_Post_Helper::has_access();
    }
    function chris_ppp_get_no_access_content() {
    return Woocommerce_Pay_Per_Post_Helper::get_no_access_content();
    }
    I don't know how you have your stuff structured but if you just have their paid content inside a section i'd set a condition on that section to show only when chris_ppp_has_access == 1
    1 is true
    then in another section add a code block that does
    echo chris_ppp_get_no_access_content();
    and only show that section when
    chris_ppp_has_access != 1
Viewing 1 replies (of 1 total)
  • The topic ‘not hiding content when using template’ is closed to new replies.