How to customize this shortcode which shows the number of views of a single post
-
I’ve defined a shortcode in my
functions.php
like the following which shows the number of views of the current post by inserting[mwpp]
in post editor.function mywpp() { return wpp_get_views(get_the_ID(), 'all'); } add_shortcode('mwpp', 'mywpp');
1– Now I want to have something like
[mwpp id="71" range="X"]
in post/page editor whick X is one of thedaily
,weekly
,monthly
, orall
. How can I accomplish this?
2– How can I put the counter above in adiv
class like the below?.wppcounter{ color:#fff; background:#ca333e; }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to customize this shortcode which shows the number of views of a single post’ is closed to new replies.