• Please how to change code if I want this? >

    dont display on wordpress home page
    display only on woocommerce home page

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author alexstandiford

    (@alexstandiford)

    Hello!

    That can be done with a custom logic filter. Check out the documentation on this page for more info:
    https://github.com/alexstandiford/easy-age-verifier#custom-logic-filter

    Thread Starter petrmalecek

    (@petrmalecek)

    Example is for displaying your age verifier on the home page.
    Please can you make example for displaying verifier on the woocomerce shop base page?

    It really make sence to display it only there. I think that every user of your plugin will appreciate this guide.

    Yes, displaying shop-only would be handy ??

    I did the following…

    https://github.com/alexstandiford/easy-age-verifier#custom-logic-filter

    //The function that adds the check. Be sure to pass the $checks variable

    function home_page_disable_verifier($checks){
    //Check if the current page is the home page
    if(is_home()){
    //If it is, add the check ID key, and set it to true.
    $checks[“is_home_page”] = true; // is_home_page can be whatever you want it to be. Make sure it’s unique!
    }
    else{
    //If not, add the check ID key, and set it to false.
    $checks[“is_home_page”] = false;
    }
    //Returns the array with the newly added boolean
    return $checks;
    }
    add_filter(‘eav_custom_modal_logic’,’home_page_disable_verifier’);

    But now what do I do if I want to disable the Age Verifyer on all pages that are not the home page?

    I know it would be something like this but this is to display a warning on those pages and I want it to be disabled completely…
    //The function that adds the content if you’re on the home page.

    function load_home_page_warning(){
    echo “Warning! Content on this site is not suitable for visitors under the age of 18.”;
    }
    //Ties the action to when the home page returns false.
    add_action(‘is_home_page_custom_is_false’,’load_home_page_warning’);

    By the way I tried that code and it didn’t seem to add any warning to the home page like it was supposed to. I don’t need to know how to do that I just wanted to test and see if it worked and it didn’t.

    So how would I edit that code to disable it on all pages except for the home page?

    Thanks,

    • This reply was modified 7 years, 9 months ago by marketing2.
    • This reply was modified 7 years, 9 months ago by marketing2.
    Plugin Author alexstandiford

    (@alexstandiford)

    @marketing2 – All you should need to do is change if(is_home()) to if(!is_home()) and it should do exactly what you’re trying to do.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Verify popop only on woocommerce main/entry page’ is closed to new replies.