Display total number of images/pictures for a post in WordPress

To display total number of images/pictures from a post is a very useful way to telling your visitor how many picutres you have in a page.

 

Go to functions.php file and add the following code, this is for creating the function prototype:

 

Then, call the function which we just created at where ever you need to display it, normally we just put into the file “single.php”:

 

That’s it.

 

</catmee> 文章全部原创、谢绝转载,作者「BianLei」,如果喜欢欢迎分享链接,相关内容参见本站版权声明
本站相关:哔哩哔哩 | QQ空间 | YouTube ★★★ 打赏:支付宝 ★★★
Tagged . Bookmark the permalink.

COMMENTS: 2

  1. VincentJax says:

    I have found plenty of helpful info on your site this page in particular. Many thanks for sharing.

Comment Anonymously? No Problem! | 可以匿名评论了我会说?

Fill up Email address to subscribe reply and display your avatar from Gravatar (If any)
填写邮箱即可显示您在Gravatar的头像