WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Slider using Custom Post Types with Custom field images (5 posts)

  1. jhopson
    Member
    Posted 4 years ago #

    Hey! Well if you attempt to help me on this, thank you in advance. After spending literally 20 hours on this yesterday I have come to the end of my limited knowledge…I need help.

    Goal: To create individual custom posts that each have a slideshow with thumbnails that pull the images from custom fields inside the custom post. For better understanding view the test site http://focalpoint.themedemo.net/portfolio/painted-hills-at-sunset#

    Here is my problem. I am using a custom post type (Portfolio) and have created 10 custom fields for image inputs. I need to create a loop that starts at the field custom field and displays the 'billboard' image and its corresponding thumbnail. (By the way I have created the different image sizes in the functions file. 'billboard' and 'thumb') Since all 10 images are on the same custom post, I am unfamiliar with how to access each one, since I believe the_post_thumbnail() only applies to 1 image. I have attempted this through many different loops, assuming that a foreach would be my best solution, but to no avail. I will post my code in hopes that someone will be able to offer a solution.

    Remember we are dealing with a custom post type/ 10 custom field images/ and thumbnails linking to larger billboard images. Whew this has driven me crazy!

    [Code moderated as per the Forum Rules. Please use the pastebin]

  2. jhopson
    Member
    Posted 4 years ago #

    Update: I have managed to get the billboard to show the original 'billboard' slide image and all 10 custom field 'thumbs'.

    It seems that the only problem I am continuing to have is when the slider goes to the next thumbnail, the 'billboard' sized image does not display.

    View the site again for better understanding.

  3. jhopson
    Member
    Posted 4 years ago #

    Question: The more I think about it, I wonder if I need to use the same loop to control both the slide and the thumbnail. Although the thumbnail then wouldn't directly "link" to the larger billboard image. It would give the appearance since both would load and slide at the same time. Any thoughts?

  4. jhopson
    Member
    Posted 4 years ago #

    solved! I managed to work for three days on this issue and it finally clicked.

  5. DavidM
    Member
    Posted 3 years ago #

    Hi there jhopson,

    Care to share the code on this one? Hopefully you might spare some of us 3 days of sleepless nights! ;)

    Cheers,
    DavidM

Topic Closed

This topic has been closed to new replies.

About this Topic