Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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 8 years, 7 months ago by jmalevic.
    #505848

    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

    #505948

    Hello,

    Thank you for the reply.

    #506269

    Hi!

    We added the code for you. You can find it right after the copyright field: http://erodog.com/

    Regards,
    Ismael

    #506294

    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.

    • This reply was modified 8 years, 7 months ago by jmalevic.
    #506361

    Hey,

    Glad we could help. Please be sure to mark topics like these NSFW in the future.

    Thanks,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘show number of posts wrapped by’ is closed to new replies.