• Resolved George

    (@giorgos93)


    Hi, Hector! Just wanted to ask, if WPP plugin can replace YARPP plugin, by showing related posts at the end of each post (based on categories and posts’ names, for example)?

    Is it possible to do smth like that with the help of your plugin?: https://skrinshoter.ru/sWcFmsi395X

Viewing 4 replies - 16 through 19 (of 19 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    No idea what’s going on then. It works on my end as expected.

    At this point I believe it might be a good idea to reach out to a developer and have them look into this for you. There’s something wrong on your end and only someone with access to your site can help you figure out what the problem is.

    Thread Starter George

    (@giorgos93)

    If this code works correctly, then is it okay to use it for [wpp] shortcode at the end of each post (through Ad Inserter)? Or it has problems?:

    <?php
    if (function_exists('wpp_get_mostpopular')) {
        echo '<div class="wpp-custom-heading">ЧИТАЙТЕ ТАКЖЕ:</div>';
        wpp_get_mostpopular(array(
            'range' => 'last30days',
            'limit' => 6,
            'post_type' => 'post',
            'thumbnail_width' => 185,
            'thumbnail_height' => 140,
            'wpp_start' => '<div class="wpp-custom-cards">',
            'post_html' => '<div class="wpp-custom-card"><div class="wpp-custom-thumb">{thumb}</div><div class="wpp-custom-title"><a class="wpp-custom-title-link" href="{url}">{text_title}</a></div></div>',
            'wpp_end' => '</div>'
        ));
    }
    ?>

    And this code in functions.php (so it can work for both of my [wpp] shortcodes):

    function wpp_shortcode_filter_by_current_category( $out ) {
    if ( is_single() ) {
    $post_id = get_queried_object_id();
    $post_category_IDs = wp_get_post_categories( $post_id, array( 'fields' => 'ids' ) );
    $out['cat'] = $post_category_IDs[0];
    $out['pid'] = $post_id;
    }
    return $out;
    }
    add_filter( 'shortcode_atts_wpp', 'wpp_shortcode_filter_by_current_category', 1, 1 );

    Both of these codes work as expected.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Well, if that code works the way you expect it to then that’s good, right? 😛

    Anyways, if you have any other comments / questions please let me know.

    Thread Starter George

    (@giorgos93)

    Anyways, if you have any other comments / questions please let me know.

    I’ve already asked it, but you sent me a documentation, where tbh I wasn’t able to find what I need 😀 I just want to add target=”_self” both to a links, and links inside img in this shortcode for posts (btw I use your option to open links in new tab for sidebar WPP widget):

    <?php
    if (function_exists('wpp_get_mostpopular')) {
        echo '<div class="wpp-custom-heading">ЧИТАЙТЕ ТАКЖЕ:</div>';
        wpp_get_mostpopular(array(
            'range' => 'last30days',
            'limit' => 6,
            'post_type' => 'post',
            'thumbnail_width' => 185,
            'thumbnail_height' => 140,
            'wpp_start' => '<div class="wpp-custom-cards">',
            'post_html' => '<div class="wpp-custom-card"><div class="wpp-custom-thumb">{thumb}</div><div class="wpp-custom-title"><a class="wpp-custom-title-link" href="{url}">{text_title}</a></div></div>',
            'wpp_end' => '</div>'
        ));
    }
    • This reply was modified 10 months, 2 weeks ago by George.
Viewing 4 replies - 16 through 19 (of 19 total)

The topic ‘Can WPP plugin replace YARPP?’ is closed to new replies.