• Why doesn’t this work?

    			<!-- mfunc mycode -->
                wp_list_comments( apply_filters( 'woocommerce_product_review_list_args', array( 'callback' => 'woocommerce_comments' ) ) );
                <!-- /mfunc mycode -->

    It loads the comments the first time after clearing cache, but then the 2nd time they’re gone?

    Notes: I’ve got the PRO version, got fragment caching already working in the header.

    The page I need help with: [log in to see the link]

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

    (@dannykater)

    It seems like global $post, $product doesn’t work anymore after it’s cached?

    Eventually i got it working by retrieving the current URL with

    $actual_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

    ,getting the post ID based on that URL and with the post ID I was able to rebuild the wp_list_comments() function.

    Any better way of doing this?

Viewing 1 replies (of 1 total)

The topic ‘mfunc and wp_list_comments()’ is closed to new replies.