• Resolved VikingIvy

    (@vikingivy)


    WordPress 4.3.1 running Dynamik-Gen theme. The website is not live yet so I can’t send links.

    I am totally new to PHP code and working things that were already in place. I have created a custom post type called “listings” and have used the [WPCR_INSERT] with a lot of display:none CSS to get only the stars displaying in each listing block on the multiple listing page. The listings are displayed on the page via shortcode which has been setup in the custom-functions file. Here is the HTML output portion of that shortcode:

    $listings_html .= '
    	<div class="listingpost">
    		<div class="listingimage">
    			<a href="'.get_post_permalink($listing->ID).'" title="'.get_the_title($listing->ID).'" target="_blank" rel="nofollow"><img src="'.$featured_image_url.'" alt="'.get_the_title($listing->ID).'" class="size-full" /></a>
    		</div>
    		<div class="listinginfo">
    			<h5><a href="'.get_post_permalink($listing->ID).'" title="'.get_the_title($listing->ID).'" target="_blank" rel="nofollow">'.get_the_title($listing->ID).'</a></h5>
    			<span class="featureaddress">'.get_field('address', $listing->ID).', '.get_field('city', $listing->ID).'</span>
    			<br />
    			<br />
    			<span class="listingcontent">'.get_the_content('<br /><br />Find Out More...').'</span>
    		</div>
    		<div class="reviewteaser">
    			'.do_shortcode('[WPCR_INSERT]').'
    		</div>
    		<div class="reviewlink">
    			<a href="'.get_post_permalink($listing->ID).'#reviewanchor" title="'.get_the_title($listing->ID).'" target="_blank" rel="nofollow">Leave A Review</a>
    		</div>
    		<div class="googlemaplink">
    			<a href="'.get_post_permalink($listing->ID).'#mapanchor" title="'.get_the_title($listing->ID).'" target="_blank" rel="nofollow">Show Map</a>
    		</div>
    		<div class="videolink">
    			<a href="'.get_post_permalink($listing->ID).'#videoanchor" title="'.get_the_title($listing->ID).'" target="_blank" rel="nofollow">Play Video<i class="fa fa-youtube-play"></i></a>
    		</div>
    	</div>

    The problem is that the stars are not showing the aggregate sum from the individual listings. They are showing the default rating from 0 reviews. Every listing has reviews that are displaying correctly on the single listing pages.

    If anyone has any ideas on which way to turn, I would be forever grateful!

    https://www.ads-software.com/plugins/wp-customer-reviews/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter VikingIvy

    (@vikingivy)

    For those having the same issue…here’s what worked in the end:

    <div class="reviewteaser">'.do_shortcode('[WPCR_SHOW POSTID="' . $listing->ID . '"]').'</div>

    Thread Starter VikingIvy

    (@vikingivy)

    Forgot to mark resolved!

    VikingIvy Did this allow you to show only the average rating without displaying reviews?

    If so great as that is what I am trying to achieve!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Aggregate Rating Displayed On Posts Page’ is closed to new replies.