Forums

Total image count for post page (2 posts)

  1. theresavs
    Member
    Posted 3 years ago #

    I'm looking for a php script that will give me the total number of images on a post page. I've been able to get something to work for individual posts from here: http://www.mattvarone.com/wordpress/images-post-wordpress-regular-expressions/

    That only works for individual posts though, but not for gettin the total image count for the entire post page. Can anyone help me modify that script or write up another script to do this? I know minimal php, so I need your help.

    FYI - I need the total image count data on a horizontal scrolling theme to modify the wrapper div width so that it will hold the images, which of course vary from page to page.

  2. theresavs
    Member
    Posted 3 years ago #

    Got the answer! It's a combination of the script from the link above and this jquery calculation:

    http://stackoverflow.com/questions/1015669/calculate-total-width-of-children-with-jquery

    Hope that helps someone else. I was able to finish designing a horizontal photo blog successfully with it. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags