• Hello folks, I am a newbie to coding and PHP, but I am attempting to build a WordPress theme for a personal blog and need some help from the WP / PHP experts.

    I am using the “catch_that_image()” function to pull out the first image of every post and display it as a Thumbnail (through Timthumb)

    I am trying to figure out a way in which the function can be modified to pull out a random image from every post. [Instead of the first post, it should pull out a random image]

    Since most of my posts will have atleast 25 images each, it would be great if the function can pull out a random image from these 25 to use as a thumbnail.

    If an occasional post has less than 25 images and the function is unable to find the random image it is looking for, it should just show the first image as a default.

    Please help me out here ??

    The “catch_that_image()” discussion is on this link:
    https://www.ads-software.com/support/topic/retreive-first-image-from-post

Viewing 1 replies (of 1 total)
  • Thread Starter maxxis

    (@maxxis)

    Please please please help…. ??

    This is the function:
    ——————————-

    [code moderated according to forum rules - please use the pastebin]

    ***********************************************************

    Instead of the first image from every post, I just need the function to pull up a random image from every post... WP / PHP experts please help me. I have already spent two full days trying to do something, and nothing worked.

Viewing 1 replies (of 1 total)
  • The topic ‘Modifying the "catch_that_image()" function to pull a random image.’ is closed to new replies.