Support » Plugin: WPAdverts - Classifieds Plugin » Advert ratings

  • Resolved teeboy4real

    (@teeboy4real)


    Hello,

    I use this popular plugin https://wordpress.org/plugins/rate-my-post/ which has support for custom post types and in the settings I added advert as custom post type but the star ratings are not being displayed in the adverts.

    The plugin also has two shortcodes
    [ratemypost] – embeds rating widget – How can I add or display this immediately below the show contact information button

    [ratemypost-result] – embeds results widget – How can I add or display this immediately below the advert gallery

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    1. you can do that using adverts_tpl_single_bottom filter

    
    add_filter( "adverts_tpl_single_bottom", function( $post_id ) {
      do_shortcode( "[ratemypost]" );
    }, 1000 );
    

    2. you can do that with the adverts_tpl_single_top filter

    
    add_filter( "adverts_tpl_single_top", function( $post_id ) {
      do_shortcode( "[ratemypost-result]" );
    }, 50 );
    

    Both code snippets you can put in your theme functions.php file.

    Thread Starter teeboy4real

    (@teeboy4real)

    Hello your code didi not work it worked when I included (echo)

    add_filter( "adverts_tpl_single_top", function( $post_id ) {
      echo do_shortcode( "[ratemypost-result]" );
    }, 50 );
    add_filter( "adverts_tpl_single_bottom", function( $post_id ) {
      echo do_shortcode( "[ratemypost]" );
    }, 1000 );
    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    ok great, thanks for the feedback, i am marking this thread as resolved then in case something will have the same issue :).

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.