WordPress.org

Ready to get started?Download WordPress

Forums

Associated Photo, ala Ma.tt (4 posts)

  1. nathanrice
    Member
    Posted 6 years ago #

    I'm playing around with the new Gallery feature in 2.5, but I can't seem to find any extensive documentation on it.

    Basically, what I'm wanting to do is create a gallery by uploading some photos, then pull the first photo in the gallery (the thumbnail) and use it as a "feature" image on the blog homepage, kinda like Matt does on his homepage for the posts that have galleries.

    http://ma.tt/

    Anyone have any ideas? I'd email Matt, but I don't want to bother him with this kind of question.

    Thanks!

  2. nathanrice
    Member
    Posted 6 years ago #

    bump ... sorry, I posted this late last night.

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    The gallery pulls the children of the post like this:

    $attachments = get_children("post_parent=$id&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC");

    If you were to do that in the theme, possibly in the Loop, then you could look at the first attachment in that array to see the first attachment and get its thumbnail and such. You'd use wp_get_attachment_link($attachment-id, 'thumbnail', true) to get the link to the thumbnail.

  4. paraksaber
    Member
    Posted 6 years ago #

    yeah, that is the basic code, but i have a minitutorial with 2 functions.
    http://paraksaber.com search "Como tener un Gallery como el de Ma.tt" and you got to found where put this code in spanish. maybe i can upload my category-#.php file for your help

Topic Closed

This topic has been closed to new replies.

About this Topic