• Resolved a4jp

    (@a4jpcom)


    How do we turn off the prettify setting and get the number with a comma?

    I have a sidebar with a list of popular posts here [ redundant link deleted ] but need to find a way to remove the prettify formatting through the shortcode. I also want the number to have commas. Can you give me some samples of shortcode that works please?

    [wpp post_type='post' limit=28 range='all' order_by='views' cat='71,-140' thumbnail_width='130' thumbnail_height='73' wpp_prettify_numbers="false"]

    [wpp post_type='post' limit=28 range='all' order_by='views' cat='71,-140' thumbnail_width=130 thumbnail_height=73 stats_views=1 include_views_text=1 stats_comments=0 number_format=1 include_views_text=0]

    I know I can get numbers with commas for a page like this

    [wpp_views_count number_format=1 include_views_text=0]

    The page I need help with: [log in to see the link]

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

    (@hcabrera)

    Hi @a4jpcom,

    The “prettify numbers” functionality can be only disabled via the wpp_prettify_numbers filter hook, it can’t be done via shortcode.

    Please add the following code snippet to your theme’s functions.php file to disable it:

    /**
    * Disables WP Popular Posts' "Pretty Numbers".
    *
    * @param bool $pretty_numbers
    * @return bool
    */
    add_filter('wpp_prettify_numbers', '__return_false');
    Thread Starter a4jp

    (@a4jpcom)

    Can you add the shortcode option to the next update please? Sometimes I need prettified number on some pages but not on others? I also need numbers with and without commas depending on designs.

    Thread Starter a4jp

    (@a4jpcom)

    Also how do I change the “view/views” to “View/Views” or “回” per sidebar instance or remove the word form some pages. I have both English and Japanese versions in different sidebars.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Can you add the shortcode option to the next update please? Sometimes I need prettified number on some pages but not on others? I also need numbers with and without commas depending on designs.

    Thanks for the suggestion, I’ll keep that in mind. No promises though.

    Also how do I change the “view/views” to “View/Views” or “回” per sidebar instance or remove the word form some pages.

    Please read this, same principle applies here: https://wordpress.org/support/topic/remove-posted-on-6/

    Thread Starter a4jp

    (@a4jpcom)

    Thanks for the help. I saw the example <li>{thumb} {title} <div class="wpp-stats">Viewed {views} times, published on {date} under {category}</div></li> and link https://github.com/cabrerahector/wordpress-popular-posts/wiki/2.-Template-tags#parameters that explains everything but couldn’t find a simple example of what I’m trying to get from the older version of the plugin.

    This code below is very close but how do I add the eye icon before the view count? Can you also add this to the shortcode sample to your page so it is easier to see how to migrate from the older version of the plugin.

    すべての閲覧数
    [wpp post_type='post' limit=28 range='all' order_by='views' cat='-71,140' thumbnail_width=130 thumbnail_height=73 post_html='{thumb} {title} {views}']

    The code below was also great but what else can I add to turn off the view word sitewide? It might be quicker if I can just disable the word for now.

    /**
    * Disables WP Popular Posts’ “Pretty Numbers”.
    *
    * @param bool $pretty_numbers
    * @return bool
    */
    add_filter(‘wpp_prettify_numbers’, ‘__return_false’);

    Plugin Author Hector Cabrera

    (@hcabrera)

    how do I add the eye icon before the view count?

    Please give this a try:

    [wpp post_type='post' limit=28 range='all' order_by='views' cat='-71,140' thumbnail_width=130 thumbnail_height=73 post_html='<li class="{current_class}">{thumb} {title} <span class="wpp-meta post-stats"><span class="wpp-views">{views}</span></span></li>']

    what else can I add to turn off the view word sitewide?

    There’s currently no way to do this. You’ll have to use the post_html parameter as suggested on every shortcode instance to customize their HTML output to your desired layout structure.

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.