integrating with GD Star Rating

Hello

I would like to render the review of my products when people share the content.

GD Star Rating plugin uses this function for rendering

wp_gdsr_render_review();

http://www.dev4press.com/document/function/wp_gdsr_render_review/

I have tried to use your suggestion below but it is not working. Any recommendation??

<?php
if ( function_exists( 'wpmudev_pwal' ) )
echo wpmudev_pwal( custom_description() );
else
echo custom_description();
?>
Also create a function in your functions.php to call necessary css and js files, like so:
<?php
function my_pwal_customization( ) {
global $pwal;
if ( !is_object( $pwal ) ) return;
$pwal->load_scripts_styles();
}
add_action( 'template_redirect', 'my_pwal_customization', 2 );
?>

Thanks

  • Hakan
    • The Incredible Smush

    Hi,

    Normally such an application is not supported, because PWAL needs *post content* to be modified. Please note “Some custom post types use templates which take the post content directly from the database. For such applications…” sentence in PWAL customization instructions. In your case there is only some html codes derived by GD Star Rating plugin, not the post content itself.

    However I think I found a hack for you. It works fine for me, but I cannot confirm that it works in all cases. Just change the code to be included to your template as follows:

    global $post;
    if ( function_exists( 'wpmudev_pwal' ) && function_exists( 'wp_gdsr_render_review' ) ) {
    echo wpmudev_pwal( '[pwal id="1" description="Here is some description text"]'. wp_gdsr_render_review( $post->ID, 0, "oxygen", 20, "oxygen_gif", false ) .'[/pwal]' );
    }

    Important note: I didn’t check the functionality of wp_gdsr_render_review function itself. I just checked that star rating reveals after a like. You may need to check parameters of the function, as your above link is protected. But what I can say, echo parameter should be set as false.

    I hope it helps.

    Cheers,

    Hakan

  • Hakan
    • The Incredible Smush

    Hi,

    I didn’t test it, but if it works for a single page, it should work on an archive page too. However do not forget to set “Enable for multiple post pages” setting of PWAL as Yes, as an archive page is a multiple post page.

    Cheers,

    Hakan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.