• Resolved jeferssons

    (@jeferssons)


    Hello, the plugin is fantastic. But I have a question. I can create a custom post types with the name gallery, so that within another post types I can pull exactly the gallery of the images relating to the post? How can I make the custom post / post-name / custom-post or / term.

    Because I’m stopped for a week on this problem. I’ve tried many things already. But I can not generate automatic id to continue, such as the tmdb site: https://www.themoviedb.org/tv/60735-the-flash/images/posters.

    Note that the post-name appears before the images / posters. I’m having trouble doing this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor 10Quality

    (@10quality)

    I am not getting what you are trying to accomplish, but there are lots of ways to customize and display a specific gallery.

    You can read this at the plugin documentation.

    You can use the following global functions to accomplish what you are looking for:
    the_gallery( $post_id ) or $attachments = get_gallery( $post_id )

    Maybe you can show the exact issue with code samples.

    Thread Starter jeferssons

    (@jeferssons)

    My question is this. I created fake pages. Within these fakes pages I’m going to call each gallery the movies or series, seasons of the TV series and pictures of the actors. On the home page I would like to limit how many images may appear. Example I uploaded 10 images. I just want to limit only to 4 pictures. When the person clicks a link to another page that these 10 images should appear is possible, if so? How can I do this.

    Plugin Contributor 10Quality

    (@10quality)

    You can for sure, just limit you your loop in your template.

    Sample code in your template:

    
    <?php $attachments = get_gallery( $post_id ) ?>
    
    <?php for( $i = 0; $i < count( $attachments ) && $i < 4; ++$i ) : ?>
    
        <?php $attachment = $attachments[$i] ?>
    
    <?php endfor ?>
    

    See how I limited my for loop to only 4 pictures…

    • This reply was modified 7 years ago by 10Quality.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘About custom post types related – acf’ is closed to new replies.