Need help? Check out our Support site, then

Removing an image from a gallery but keeping it in the post with the gallery

  1. Hi,

    I'm currently using WordPress to create a portfolio and am having a bit if a problem with the gallery function. The structure I am using for the portfolio is a post per project and within that post I am inserting one large (main) image from the project and the rest of the images in a gallery below the large image. The problem is that when I insert an image into the post (not into the gallery) it automatically appears in the gallery so i have the main image appearing in the post and in the gallery which I don't want. You can see this occurring on the post titled 'Footwear Design; Urban Eco Street Sandal, Pentland Brands – London'. When i then delete it from the gallery it deletes it from the post and from my media library so the image is gone completely.

    On the second post titled 'Concept Generation; Theft Prevention Products for Travellers, Middlex Uni – London' this problem hasn't occurred and I can't work out how i did it.

    My blogs url is: Please let me know if there is a solution to this conundrum.

    Many thanks.


    The blog I need help with is

  2. If you want to exclude a particular image from the gallery then you can do this by adding the correct parameter to the shortcode:

  3. Thanks,

    I followed the link but it is not clear to me how I access the shortcode. I am relatively new to WordPress, how do I access the short code for my image?


  4. Please scroll down in the section westi linked to:

    * Note: To get an attachment ID for an image, go to your Media Library and hover over the image title you want to exclude. You can find the ID in the URL (the number after attachment_id=).
    [gallery id="402"]
    [gallery columns="5" orderby="title DESC, ID ASC"]

  5. I did see the attachment ID by hovering over the image but what I can't work out is where do I go to add the correct parameter to the shortcode to remove the desired image from the gallery?

  6. Switch the editor to html mode / view - then you should see something like [gallery] put the short code inside the [ brackets ]

  7. [gallery order="DESC" columns="6"]

    that is the short code for the gallery and the attachment ID for the image I would like to exclude is 31. So what do I enter into that short code and where do I put it?

    Many thanks.

  8. Try:

    `[gallery order="DESC" columns="6" exclude="31"]

  9. That doesn't seem to work.

  10. My only guess is there is an order to things - try moving exclude up is my only guess:

    [gallery exclude="31" order="DESC" columns="6" ]

    This is what worked on a test site:

    [gallery exclude="589"]

  11. No combination is working. Very irritating. Thanks for the suggestions though everyone.

  12. Can you be a little more specific, since your blog is private, we can't see the problem.

    You say you can see the excluded image in your Gallery. But where? On the front page of your blog, in the blog post itself? On an attachment page? If the problem is on an attachment page and you don't want the thumbnail of the excluded image to appear in the navigation, try changing your Gallery settings to show images when clicked on rather than attachment pages.

  13. My blog is now no longer set to private. If you go down to the 4th post title 'Night Pal; Childs Nightlight, Dezac – London' you will see the main image there title 'Concept 3 - Cry Reader'. Below this main image you can see the gallery in the same post and within the gallery is the main image again.

    This is the issue as I do not want the main image repeated in the gallery. You will notice that this problem has not occurred in the previous 2 posts with the same format but this is only an anomaly, if I got back into the gallery to update the info the main image will appear in the gallery.

  14. Also I should note that at this stage I do not have any pages, only the home page on which all content will be displayed.

  15. Can you copy that post's gallery shortcode from the HTML editor and paste it here?

  16. About your last comment, each of those entries are Posts, which can be viewed individually.

  17. [gallery exclude="31" link="file" order="DESC" " columns="6"]

    Does that mean each post has its own url?

  18. There's a misplaced quotation mark; try removing it.

    Yes. For example the Post with the problem Gallery is

  19. I removed the misplaced quotation mark so the code now looks like this:

    [gallery exclude="31" link="file" order="DESC" " columns="6"]

    Still hasn't worked.

  20. [gallery columns="6" exclude="31"]

    Try starting with that only.

  21. I pasted that in the place of the existing gallery short code but it had no effect.

  22. Is "31" the image name or the image ID number?

    To find the image ID number read these instructions:

  23. ahha I think you've cracked it but the problem now is that when I follow the instructions within the link you posted and hover over the image name/thumbnail/edit button I don't see the code for the image anywhere?

  24. What browser are you using? It should show in the Status Bar. Make sure it's enabled.

  25. I'm using firefox but there is no status bar and I can't find any way to enable it?

  26. Please tell us exactly which version of Firefox you are using.
    Also do you have another browser that you can try?

  27. I'm logged in with Firefox at the moment. In the View Menu, make sure "Status Bar" is checked.

Topic Closed

This topic has been closed to new replies.

About this Topic