WordPress.org

Ready to get started?Download WordPress

Forums

how to limit gallery shortcode images for front page (9 posts)

  1. anil3a
    Member
    Posted 2 years ago #

    I am using gallery shortcode [gallery] for every post to display related images. I almost had 20 images for one post so when i display recent posts in my home page, all images are shown and looks really messy and length home page while showing recent 3 post.

    Can there be any way to limit the attached images of the post to few images with permalink to the post to show full images of that post.

    Excerpt does limit the post text but does not work for images, i know.
    I also tried Gallery Extended for using attributes in [gallery] like [gallery link=file start=1 end=6], and its more flexible for displaying desirable images in the post, but other remaining images are hidden.
    Please help me in this.

  2. vidanov
    Member
    Posted 2 years ago #

    If I understood correctly, you can do it like this:

    put in the post excerpt [gallery link=file start=1 end=6]
    and put in the post itself [gallery link=file]

    If your theme shows post excerpt on the home page, it will show only 6 images there and all of them on your post page.

  3. anil3a
    Member
    Posted 2 years ago #

    Sorry man!!..... that does work too.
    If i put that in post excerpt then instead of showing image, it shows the code.
    But any thanks for this great plugin, its more flexible for showing images with text up and down.... thanks.

    For my problem, I used Custom fields to show some particular images to the homepage.

  4. anil3a
    Member
    Posted 2 years ago #

    Sorry man!!..... that does work too.

    I mean to say......

    Sorry man!!..... that doesnot work.

  5. vidanov
    Member
    Posted 2 years ago #

    Sorry for the wrong tip!

    If you can edit theme files, then you can put in the home page php short code execution in the place near the_excerpt or the_content tag you can show the images like this:

    <?php echo do_shortcode('[gallery start="1" end="6"]'); ?>

    I think about, maybe I can integrate some solution in the plugin for you.

  6. anil3a
    Member
    Posted 2 years ago #

    Ya that does work...... its showing only number of images that it mentioned but not so flexible one. One have to go to the template to do that. And also, if when i activate the plugin, all images, when clicked in post, opens separately, not in Attachment template.

    So sorry for that. I also have no idea how to get it open in attachment.php page so users can have our template view and can leave comments and likes on it.

    So still hanging on those custom fields for showing some images in home page. I would love use your plugin if this was possible. Thank you

  7. vidanov
    Member
    Posted 2 years ago #

    I released new version 1.1 where you can set up a default mode for links in gallery. It acts like wordpress gallery by default. And you can have always linked to attachment and to file if you want to (like me).

    >> One have to go to the template to do that.
    Yes. But you know. Such feature is very special and somebody needs it, somebody does not. It is also different in different templates. I think the best solution here - to make changes in the template.

  8. anil3a
    Member
    Posted 2 years ago #

    Wow!! Thats great then .. i will try this new plugin and surely feedback and rate it.

    But, where is the link to new plugin ?????????????
    I only see Version 1.0 with Change logs included of new version 1.1, is it the new version in it ??

    Thank you very much for giving your time.....

  9. anil3a
    Member
    Posted 2 years ago #

    Ok i got it......

    Its the new version, 1.1 but why didn't you changed the name of the version to 1.1 .......

    ok thanks .... will come back after trying.

Topic Closed

This topic has been closed to new replies.

About this Topic