Hello,
I want to show number of posts in the footer of my site (using enfold).
The number of posts needs to be wrapped by <!– 全記事数 –> (i.e. the post number needs to have a <!– 全記事数 –> before it and after it. its a condition for registering to a certain antenna site)
I think the below code should do the trick but for some reason the <!– 全記事数 –> does not show in the source code.
<?php $numposts = $wpdb->get_var(“SELECT count(*) FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_type IN (‘post’, ‘news’, ‘photo’)”);
if (0 < $numposts)$numposts = number_format($numposts);echo ‘ 動画数:<!– 全記事数 –>’. $numposts .'<!– 全記事数 –>動画’;?>
If I try this in the default twenty fourteen theme for example the <!– 全記事数 –> shows before and after the post count in the source code but on enflold it does not.
My code is in the footer.
Any idea what I can do to fix this?
Many thanks in advance.
Hi jmalevic,
Could you please provide us with a temporary admin login so that we can take a closer look? You can post the details in the Private Content section of your reply.
Best regards,
Rikard
Hello,
Thank you for the reply.
Hi!
We added the code for you. You can find it right after the copyright field: http://erodog.com/
Regards,
Ismael
Thank you for your help.
Sorry could you please tell me what code you changed to make the <!-- 全記事数 -->
show?
The code showing up is <!– 全記事数 –> but it should be <!-- 全記事数 -->
For some reason there is one too many dashes and if I try to fix it the <!-- 全記事数 -->
it is not showing again.
Please see below pic, the code on the right is correct.
http://erodog.com/wp-content/uploads/2015/09/code.jpg
Thanks again for your help.