Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • I used this in my template:

    
    <?php echo do_shortcode(' [WPCR_SHOW POSTID="' . $post->ID . '" NUM="5" PAGINATE="1" PERPAGE="5" SHOWFORM="1" HIDEREVIEWS="0" HIDERESPONSE="0" SNIPPET="" MORE="" HIDECUSTOM="0" ]'); ?>
    

    Hi.

    Here is my solution to placed in functions.php

    
    /**
     * Adds a hidden tag to a post content to suppres review form since we output it in another place.
     * 
     * https://uk.wordpress.org/plugins/wp-customer-reviews/
     *
     * @param string $content
     * @return void
     */
    function suppres_review_output( $content ) {
    	$post = get_post();
    
    	if ( ( !empty( $post->ID ) ) ) {
    		$content = '<!-- data-wpcr3-content="' . $post->ID . '" !-->' . $content;
    	}
    
    	return $content;
    }
    add_filter( 'the_content', 'suppres_review_output', 10 );
    
    • This reply was modified 8 years, 2 months ago by gruz.
Viewing 2 replies - 1 through 2 (of 2 total)