<?php
if (function_exists('wpp_get_mostpopular')) {
wpp_get_mostpopular(array(
'limit' => 4,
'range' => 'last7days',
'order_by' => 'views',
'wpp_start' => '',
'wpp_end' =>'',
'thumbnail_width' => 50,
'thumbnail_height' => 50,
'post_html' => '
<div class="card card-body bg-light shadow-sm border-0 mb-5">
<div class="row">
<div class="col-4 col-md-5 col-lg-5 pe-lg-0 pos-rel">
{thumb_img}
<div class="date-box tx-14 tx-gray text-center content-pos">
<span class="fw-bold">{date}</span>
</div>
</div>
<div class="col-8 col-md-7">
<p class="tx-24 fw-bold mb-1 col-lg-9 blogpost-tx">{text_title}</p>
<div class="pt-4 pt-md-5">
<a href="{url}" class="fw-bold tx-24"> More Info
<img src="'.get_template_directory_uri().'/assets/img/icons/arrow-right.svg" alt="" srcset="" class="ms-5">
</a>
</div>
</div>
</div>
</div>
'
));
}
?>
]]>Tell me what you need to add to the following code so that only 5 records are displayed instead of 10?
<div class="post">
<h4 class="comment-reply-title">Top post</h4>
<?php
if (function_exists('wpp_get_mostpopular'))
wpp_get_mostpopular("range=all&order_by=views&stats_comments=1");
?>
</div> <!-- .post -->
]]>Love the plugin is easy to use. Just having this one problem that is causing my list of links to not be aligned properly if they wrap onto a second line.
I’m using this in a category page to show the top links by category
if (function_exists('wpp_get_mostpopular')) {
wpp_get_mostpopular(array(
'limit' => 6,
'cat' => $catID,
'stats_views' => 0
));
}
Even though I’ve turned off the stats_views it’s still printing in the HTML:
<span class="wpp-meta post-stats"></span>
Could you help with this at all? I’ve tried display none but the span is still causing the list spacing to shift slightly.
]]>I have scheduled posts and these are appearing as well.
How to avoid this from happening?
This is the code I’m using:
<?php
if ( function_exists('wpp_get_mostpopular') )
wpp_get_mostpopular(
array('limit' => 8,
'post_type' => 'mitos,raios-x,factos,artigos',
)
);
?>
I’ve also tried this, but the same happens:
<?php
if ( function_exists('wpp_get_mostpopular') )
wpp_get_mostpopular(
array('limit' => 8,
'post_type' => 'mitos,raios-x,factos,artigos',
'freshness' => 1,
'range' => 'all'
)
);
?>
Thanks!
]]>wpp_get_mostpopular($args);
?>
Hi, i am asking how to write if isset and !empty else statement for wpp_get_mostpopular($args) above, i am confused to write a code/syntax
Please give me example code, thx
Is it possible to limit the popularity to only display popular posts published in the last 30 days?
Thanks!
]]>For example for this scenario. I want to display at the top of my homepage my 1-3 best results, then add some other sections then display results 4-10th.
I know for 1-3 I can use limit, but what can I use to display other ranges (2-6th, 2 – N, 3-N or whatever?
]]>using below code I get popular posts.
$amadeus_pp = array (
'range' => 'last30days',
'order_by' => 'views',
'post_type' => 'post',
'limit' => 5,
'title_length' => 70,
'cat' => $blog_category_id,
'thumbnail_width' => 50,
'thumbnail_height' => 50,
'stats_views' => 0,
'post_html' => '<li style="margin-left: 0;">
<div class="ba-pop-post">
<div class="ba-pop-post-title">{author}</div>
<div class="ba-pop-post-image">{thumb}</div>
<div class="ba-pop-post-title">{title}</div>
</div>
</li>',
);
if (function_exists('wpp_get_mostpopular'))
wpp_get_mostpopular($amadeus_pp);
Now under popular post section display post thumbnail image, post title.But now I want to display post author,create date, part of description also.
Please help me…
]]>Just wanted to ask whether you can add a parameter to the function wpp_get_mostpopular that it can return generated code instead of echo it?
As I want to store generated code in the variable.
Thanks!
Roman
Here’s my code but it doesn’t work:
<?php
$most_popular_args = array(
'post_type' => 'tl-article, video, press-release, press-mention, white-papers, analyst-report, fact-sheet, case-study, customer-quotes, infographics, partnerships, on_demand_webcasts, quarterly_release, integrations, podcasts',
'limit' => 3,
'range' => 'last30days',
'stats_views' => 0,
'stats_taxonomy' => 1,
'post_html' => '<li><h3 class="mt-0"><a href="{url}">{text_title}</a><br>{post_type}</li></h3>'
);
wpp_get_mostpopular( $most_popular_args );
?>
]]>