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

    (@dpowney)

    Hi there,

    The auto placement of the rating result uses the_title() WordPress filter which can be called in multiple places on a single page. Therefore on a single page which is also in the WP loop, Multi Rating only shows the rating result once by default on the first call of the_title(). You can change and remove this logic for specific pages as follows (post ID 430 is used here in this example as this is the post ID for the URL provided above).

    Add this code to your functions.php file.

    function mr_check_auto_placement2( $filter, $post_id, $rating_form_id)  {
    	// only apply filter once... hopefully, this is the post title...
    	if ( in_the_loop() && ( is_single() || is_page() || is_attachment() ) && get_the_ID() != 430 ) {
    		remove_filter( $filter, 'mrp_filter_' . $filter );
    	}
    }
    remove_action( 'mr_after_auto_placement', 'mr_check_auto_placement', 10 );
    add_action( 'mr_after_auto_placement', 'mr_check_auto_placement2', 10, 3);

    Use FTP of course to add the code in case something unexpected happens…

    Alternatively, you can use the [mr_rating_result] shortcode rather than using auto placement.

    I hope this helps,
    Daniel

    Thread Starter mppb

    (@mppb)

    Thank you very much for the response !

    The rating result appear correctly in my portfolio pages but not in my portfolio loop (the rating appear only 1/3 projects in the loop).

    Is this code will make the rating results appear under the title in the portfolio loop ?

    PS : i’m a new with coding so i just wanna be sure of the solution ??

    Dear,

    I did this procedure on a website and it worked perfectly:

    https://fechounegocio.beehive.com.br/

    But when I did it on another site, an error message appeared:

    https://fechou-negocio.com/

    Warning: Missing argument 3 for mr_check_auto_placement2 () in /home/fechounegocio/public_html/wp-content/themes/llorix-one-lite/functions.php on line 777

    Both sites use WordPress 4.8.3 and the same version of the same theme. In fact, they are the same site, the first one is a version developed in a testing domain and the second is in the client domain. I just recreated the site, transferring all the content and installing all the plugins.

    I want to appear in each post thumbnail the stars that indicate the votes received.

    Please, what’s missing to work? I did not do anything different.

    Grateful!

    Plugin Author dpowney

    (@dpowney)

    There’s an extra parameter in the code snippet which should not be there – hence the warning. Change it to this:

    unction mr_check_auto_placement2( $filter, $post_id )  {
    	// only apply filter once... hopefully, this is the post title...
    	if ( in_the_loop() && ( is_single() || is_page() || is_attachment() ) && get_the_ID() != 430 ) {
    		remove_filter( $filter, 'mrp_filter_' . $filter );
    	}
    }
    remove_action( 'mr_after_auto_placement', 'mr_check_auto_placement', 10 );
    add_action( 'mr_after_auto_placement', 'mr_check_auto_placement2', 10, 2);

    This will fix it ??

    I too am having trouble with rating result appearing after title on Portfolio main page.
    https://legalsauce.com/reviews/

    But also does not work on Portfolio Single Post pages with auto-placement. Using shortcodes before content works.
    https://legalsauce.com/reviews/optiv/

    Works on Portfolio Category pages.

    WP 4.9.1
    Theme Kleo 4.3
    MR Pro 5.3.1

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Ratings do not appear under the portfolio title’ is closed to new replies.