Forum Replies Created

Viewing 13 replies - 16 through 28 (of 28 total)
  • Thread Starter Dylan Houlihan

    (@dylanhoulihan)

    Ohhh thanks for clarifying. I’m still learning php so I didn’t even know about the unset function. Easy fix once I got that worked out.

    Although my code might not be the cleanest, this is it for anyone reading this in the future:

    add_filter('site-reviews/schema/EmployerAggregateRating', function ($schema) {
        $post_id = get_the_ID();
    
        $ratingInfo = apply_filters('glsr_get_ratings', null, [
            'assigned_posts' => $post_id,
        ]);
    
        // modify the $schema array here.
        $schema['ratingValue'] = $ratingInfo->average;
        $schema['bestRating'] = '5';
        $schema['worstRating'] = '1';
        $schema['ratingCount'] = $ratingInfo->reviews;
        $schema['itemReviewed'] = [
            '@type' => 'Organization',
            'name' => get_post_meta($post_id, 'organization_name', true),
            'sameAs' => get_post_meta($post_id, 'organization_url', true),
        ];
        unset($schema[aggregateRating]);
        unset($schema[description]);
        unset($schema[name]);
        unset($schema[url]);
        return $schema;
    });

    Schema returns exactly how I want to now. Thanks again. Really cool how customizable this plugin is. Excited to see what else I can do.

    Thread Starter Dylan Houlihan

    (@dylanhoulihan)

    Thanks, I think my question was unclear. Sorry about that.

    Basically, my schema output currently looks like this

    I want it to look something like this.

    I guess instead of adding additional values to the default schema that the plugin provides, I want the code above to be the only values that are output.

    Thread Starter Dylan Houlihan

    (@dylanhoulihan)

    Thanks!

    Thread Starter Dylan Houlihan

    (@dylanhoulihan)

    Yeah so basically I just want to be able to display the number of reviews assigned to a specific post within any paragraph that I want.

    Could be “# users said this” or “We gathered # user reviews and found out this” etc.

    I was looking at the glsr_get_ratings() function yesterday but wasn’t exactly sure how it worked but you’re right, after a bit of testing I got it working perfectly. Should’ve dove more into it before posting this (sorry) but maybe it’ll help some others in the future.

    Anyway, here’s the shortcode I put together:

    function user_review_count_sc($atts) {
    
        $defaults = [
            'post_id' => get_the_id(),
        ];
    
        $atts = shortcode_atts($defaults, $atts, 'user_review_count');
    
        $ratingInfo = apply_filters('glsr_get_ratings', null, [
            'assigned_posts' => $atts['post_id'],
        ]);
    
        return $ratingInfo["reviews"];
    }
    add_shortcode( 'user_review_count', 'user_review_count_sc' );

    It seems to be working well. That said, I’m a complete noob at PHP, so please let me know if I’m doing something wrong or if my code could be more efficient.

    Thread Starter Dylan Houlihan

    (@dylanhoulihan)

    Ok, thanks for your help and quick replies. I will definitely be keeping an eye on future versions of this plugin as I really like how it works in terms of adding new reviews, storing them, assigning them to posts, and displaying them with a block/shortcode.

    Support for decimal ratings would be nice, but not a deal-breaker.

    Excited to see how the Review Themes add-on evolves and everything else around this plugin. Support for pros/cons list and country dropdown sounds awesome.

    Is there anywhere I can sign up to hear about updates about the Site Reviews plugin and other things you’re working on?

    Thread Starter Dylan Houlihan

    (@dylanhoulihan)

    Thanks for your reply!

    You could use the Review Forms add-on to create a form with custom fields which would allow people to submit reviews with your chosen fields.

    Would this work with adding reviews manually? At the moment I collect reviews using a Google Form and then enter them into WordPress later so I’d be adding them via the “All Reviews > Add new” button.

    I guess as an alternative I could just create a page, put the custom review form on there, and then enter them through that. Should work.

    That said, does the Review Forms and Review Themes add-ons support html lists? Couldn’t see that as an option. I’d like to use it to include a list of side-by-side pros and cons in the review.

    This is possible with a filter hook, but not recommended or supported with the add-ons

    Probably the same thing, but just want to clarify: I still want to use a 5-star rating system, I’d just like reviews to be able to include half-point ratings. So instead of 1 being the lowest possible rating, it’d be 0.5.

    Thread Starter Dylan Houlihan

    (@dylanhoulihan)

    Thanks for responding Gabe. I’ve been working on my site speed for a while now and I seem to be stuck.

    I wasn’t using CSS combination in SG Optimizer before. Would you say it’s worth using CSS combination + JS combination with Asset CleanUp Pro? I’ve just switched over and it doesn’t seem to have had a huge impact on my speed. Do you offer one-on-one help with stuff like this?

    Thread Starter Dylan Houlihan

    (@dylanhoulihan)

    Thanks for the reply. The issue seems to be that the headers I mentioned don’t even have IDs assigned to them.

    When I inspect a header that works it has a <span class=”ez-toc-section” id=””>

    When I inspect the headers that are having issues they don’t have that code.

    Thread Starter Dylan Houlihan

    (@dylanhoulihan)

    Thanks for your responses. It’s just unfortunate because I’m starting to find I need a lot of the pro features (like shortcodes) so now I’m having to look at other paid review plugins to fulfill my needs. Which is too bad because I like the way this plugin works.

    Thread Starter Dylan Houlihan

    (@dylanhoulihan)

    Ok thanks Steven, I’ll do that. Thanks for the quick response.

    Thread Starter Dylan Houlihan

    (@dylanhoulihan)

    PL 3.0.3 update fixed the issue for me as well. Thanks everyone!

    Thread Starter Dylan Houlihan

    (@dylanhoulihan)

    @rozroz Hey, so it’s a bit hard to explain… basically since Pretty Links is using a custom post type for the links now, whenever I try to edit or create a new Pretty Link, it seems to be causing a glitch where Pretty Links thinks the Target URL for the link is empty (even if it’s not).

    I contacted Pretty Links support for this and they went through my site and told me it’s because WP Product Review Lite is interfering.

    Then they told me to reach out to you guys to see if it was possible to disable WP Product Reviews on custom post types.

    Dylan Houlihan

    (@dylanhoulihan)

    Is there a way to simply add an attribute to an image to exclude it from lazy loading?

    I think with wprocket you can just add data-no-lazy=”1″ to an image and it won’t be lazy loaded.

Viewing 13 replies - 16 through 28 (of 28 total)