Support » Theme: Sparkling » Views Counter

Viewing 1 replies (of 1 total)
  • There are many ways plugins available that do that, but if you want to have full control of how and where the counter is displayed, you can easily do this yourself.
    I followed this guide to add it to my site:

    http://bacsoftwareconsulting.com/blog/index.php/wordpress-cat/how-to-track-and-display-post-views-count-in-wordpress-without-a-plugin/

    The problem will be to find the location to add the function that displays and updates the counter, it will have to be in the template that is used to dusplay your post, the one containing the heading, date and poster (as in your picture).

    I have a content-single.php in my child theme, which is supposed to be the correct location, but as I just posted, that template wasn’t used, so I temporarily added it to sparkling/template-parts/content-single.php (which will work for you too, but will be removed on an update to the theme).

Viewing 1 replies (of 1 total)
  • The topic ‘Views Counter’ is closed to new replies.