-
AuthorPosts
-
September 18, 2015 at 1:56 pm #505491
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.
-
This topic was modified 10 years, 1 month ago by
jmalevic.
September 19, 2015 at 5:43 am #505848Hi 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,
RikardSeptember 19, 2015 at 6:00 pm #505948Hello,
Thank you for the reply.
September 21, 2015 at 8:51 am #506269Hi!
We added the code for you. You can find it right after the copyright field: http://erodog.com/
Regards,
IsmaelSeptember 21, 2015 at 9:33 am #506294Thank 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.jpgThanks again for your help.
-
This reply was modified 10 years, 1 month ago by
jmalevic.
September 21, 2015 at 12:12 pm #506361 -
This topic was modified 10 years, 1 month ago by
-
AuthorPosts
- The topic ‘show number of posts wrapped by’ is closed to new replies.
