• Resolved STASEO

    (@staseo)


    Hello, I don’t work with the block editor. I can use a shortcode or php. How to migrate old settings please?:
    -Top 10 popular last week (views)
    – 1 excluded category
    – Html markup

    <div class="post"><div class="list">{thumb}<br> {title} <br>{summary}<span class="wpp-meta post-stats">{stats}</span></div></div>

    – H3 /H3 in Before / after title

    – div /div Before / after Popular Posts

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

    (@hcabrera)

    Hi @staseo,

    This would be the shortcode version for those settings:

    [wpp range='last7days' cat=-15 header='Popular Posts' header_start='<h3>' header_end='</h3>' wpp_start='<div>' post_html='<div class="post"><div class="list">{thumb}<br> {title} <br>{summary}<span class="wpp-meta post-stats">{stats}</span></div></div>' wpp_end='</div>']

    Change cat=-15 to the actual category ID you want to exclude.

    As a bonus, here’s the PHP version:

    <?php
    if ( function_exists('wpp_get_mostpopular') ) {
        $args = array(
            'range' => 'last7days',
            'cat' => -15,
            'header' => 'Popular Posts',
            'header_start' = > '<h3>',
            'header_end' => '</h3>',
            'wpp_start' => '<div>',
            'post_html' => '<div class="post"><div class="list">{thumb}<br> {title} <br>{summary}<span class="wpp-meta post-stats">{stats}</span></div></div>',
            'wpp_end' = > '</div>'
        );
        wpp_get_mostpopular($args);
    }
    ?>
    Thread Starter STASEO

    (@staseo)

    Hi Hector, thanks for the code.

    It seems that the {thumb} and the {summary} are not showed. Only the {title}. Also, I how to disable the number of views?

    Plugin Author Hector Cabrera

    (@hcabrera)

    It seems that the {thumb} and the {summary} are not showed

    Ah, you need to define the width and height of the thumbnail for it to show, otherwise it won’t. Same applies to the {summary} tag, you need to set the excerpt length. Since you didn’t share these settings I didn’t include them on my comment above ??

    See:

    [wpp thumbnail_width=100 thumbnail_height=100 excerpt_length=75 ...]

    And the PHP version:

    <?php
    if ( function_exists('wpp_get_mostpopular') ) {
        $args = array(
            'thumbnail_width' => 100,
            'thumbnail_height' => 100,
            'excerpt_length' => 75,
            // rest of the parameters
        );
        wpp_get_mostpopular($args);
    }
    ?>

    Also, I how to disable the number of views?

    If you’re using the shortcode use the stats_views parameter, like so for example:

    [wpp stats_views=0 ...]

    The PHP version would be:

    <?php
    if ( function_exists('wpp_get_mostpopular') ) {
        $args = array(
            'stats_views' => 0,
            // rest of the parameters
        );
        wpp_get_mostpopular($args);
    }
    ?>
    Thread Starter STASEO

    (@staseo)

    Thank you so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Migrating to the new plugin’ is closed to new replies.