Skip to content
Public Ticket #27055

Post count is sticking to zero

Conversation thread

guy_marong replied

Customer Reply

OK, this time it worked...:-)

Thanks for indicating me in the right direction ....

Kind regards

guy_marong replied

Customer Reply

OK, I will try again ...

guy_marong replied

Customer Reply

I know I had tried to insert the snippet into the function.php before but it didn't work out as you can see from the attached screen shot but maybe I was just too dumb to do it.

PenciDesign Supporter replied

Staff Reply

Hi,

Yes. You can copy/paste the code snippet into the functions.php of the child theme.

Regards,
PenciDesign.


guy_marong replied

Customer Reply

Hi,

OK, I admit I had to sort out the plugins (we had too many of them) and wasn't aware that removing the Code snippet plugin would also remove the code. Is it not possible to add the code snippet directly to the function.php without a plugin?

Kind regards ...

PenciDesign Supporter replied

Staff Reply

Hi,

I've checked your site, the problem is that you've deleted the Code Snippet plugin, so the post count doesn't work.

Regards,
PenciDesign.


guy_marong replied

Customer Reply

Thanks. With this kind of support I never worry...:-)

I'm very happy with this....

Kind regards ...

PenciDesign Supporter replied

Staff Reply

Hi,

I've added this code snippet for your site.

Please clear your browser's cache and then recheck.

Regards,
PenciDesign.


guy_marong replied

Customer Reply

Hi,

unfortuantely, this did not work out.

Please check attachment.

PenciDesign Supporter replied

Staff Reply

Hi,

You should insert this code either into the functions.php file of the child theme or by using the CodeSnippet plugin available here: https://wordpress.org/plugins/code-snippets/

add_filter('the_content',function($content){
    $views_html = '<span style="display:none"><i class="penci-post-countview-number">'.penci_get_post_views( get_the_ID() ).'</i></span>';
    return $content.$views_html;
});

Regards,
PenciDesign.

PenciDesign Supporter replied

Staff Reply

Hi,

For this matter, please provide me with your WordPress admin account credentials. I will log in and attempt to assist you in troubleshooting this issue.

Regards,
PenciDesign.


guy_marong started the conversation

Conversation Start

Hi,

I have just recently (today) turned on the "Show Views Count" and "Enable ajax Post View Count" button but it has no effect, the views are still on zero even though I've opened and close several news posts on the news page https://cubic-lighthouse.com/news-cybersecurity/. I've checked other tickets from users but couldn't find a working solution.

Want to join this conversation or access attachments? Sign in first.