WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Gallery orders not working how they should (12 posts)

  1. savedave
    Member
    Posted 1 year ago #

    Hi there

    I am using twenty eleven with a child theme. My site is at http://www.nadaav.com/n and in particular I am working on this page: http://nadaav.com/n/press/

    I have inserted my first gallery on this page but it is not working how I would expect. If you click on the first image - the front page of the daily mail, you go to the right page, but then if you click next you are not taken to the next image in the gallery, but to some other random images I have used elsewhere, and that I do not wish to be part of this or any other gallery.

    The other images in this gallery seem to go in the right order, so I am a little confused.

    I'm also not very happy with the page that opens when you open the image anyway - it's messy, with the page title, metadata etc. I'd like to simplify that if I could too.

    (I have previously used gallery plugins but they don't allow captions in the main gallery view).

    Thanks for any help on this

    NS

  2. paulwpxp
    Font hero
    Posted 1 year ago #

    That would be fixed in WP3.6

    adjacent_image_link() needs optimization
    http://core.trac.wordpress.org/ticket/23044

    [gallery ids=] have no influence on adjacent_image_link() for attachment pages
    http://core.trac.wordpress.org/ticket/22829

  3. paulwpxp
    Font hero
    Posted 1 year ago #

    I would always upload image to the post ( or page ) directly, so all images are technically child of that post/page. Doing this will allow me to use a very short and simple gallery shortcode like [gallery link="file"]

    What happens in WP3.5 is that it put in ids in the gallery shortcode for you, this is why the images order seen up front and in attachment page is different.

    All you have to do is making sure all images are uploaded directly to that post/page, then put in the gallery shortcode manually.

    In your case, you want images in the gallery to link to its attachment page, so your shortcode is just [gallery]. You can order the images like you did before WP3.5, the interface is different but you can still sort order images.

    Doing the above, you won't need to wait for that fix in WP3.6 at all.

  4. savedave
    Member
    Posted 1 year ago #

    Hi there

    I tried what you have suggested. Making sure everything is linked to only that one page has helped somewhat, and now the gallery items all stay together. But using just the short code you have suggested I do not know how to order the gallery - you said it's the same as pre-3.5 but I am pretty new to WP so don't know what that means.

    And it still links to a messy 'post' page, with meta data and oversized page title etc rather than just to the file. I'd like to either link directly to the file, the same as if you add an image in a page, or I would be happy with the same type of post page as is currently happening if I could remove the metadata and reduce the size of the page name (without affecting other pages).

    Thanks kindly

    SD

  5. paulwpxp
    Font hero
    Posted 1 year ago #

    I tried what you have suggested. Making sure everything is linked to only that one page has helped somewhat, and now the gallery items all stay together.

    I'm not sure what you mean by that. What I suggested is only upload images to the post/page directly.

    In WP, there are 2 ways to upload image.

    1. Upload directly to the post/page (attach to that post/page)
    2. Upload to Media Library (unattached)

    I suggest to go with the first one only.

    But using just the short code you have suggested I do not know how to order the gallery

    In edit post screen, click on Add Media and make sure the dropdown select is at "Uploaded to this post", you will be presented with thumbnails of images that uploaded to this post/page only.

    Then just drag and drop to sort order, it will automatically make live update to the database without a need to click update at all.

    And it still links to a messy 'post' page, with meta data and oversized page title etc rather than just to the file.

    So do you want your image in the gallery

    • link to image file ? or
    • link to attachment page ?

    If you want image linked to file, you will not have that next previous link problem, because there won't be any next prev link, it will be just that image file.

    To make image link to file, use my first code. To make image link to attachment page, use my second code ( the default is link to attachment, so there is no need to put in attribute ).

  6. savedave
    Member
    Posted 1 year ago #

    Hi

    thanks for this - sorry it took me a while to understand. I have it now by using the code: [gallery link="file" gallery ids="249,236,235,234,233,232"]

    At the moment I have set it to just link to the file. It's not really what I want. In an ideal world I would like them to open in a web page but not the messy looking one with metadata that they seemed to be opening.

    Do you know what I can add to style.css to tidy up that page. I would like to remove the meta data and reduce the size of the page title.

    thanks so much for your help.

    SD

  7. savedave
    Member
    Posted 1 year ago #

    Incidentally, when I just use the code [gallery ids="249,236,235,234,233,232"] as I have done in the test version on the page, the linked order is still incorrect. It is at least only using images from this page now, but not in the same order as they appear in the gallery.

  8. paulwpxp
    Font hero
    Posted 1 year ago #

    What happens in WP3.5 is that it put in ids in the gallery shortcode for you, this is why the images order seen up front and in attachment page is different.

    All you have to do is making sure all images are uploaded directly to that post/page, then put in the gallery shortcode manually.

  9. savedave
    Member
    Posted 1 year ago #

    Hi Paul.

    Thanks - yes I have nailed that and appreciate your advice. What I am now hoping to do is to resolve where the images are displayed. Currently I set gallery to link directly to the media file. I'd rather not do this but I find the nature of the page they display in if I let them link to the attachment page, is quite ugly. Lots of metadata, massive header etc.

    Is there a bit of css I can alter to allow me to edit this type of page? I am not sure the name of this type of page to find it in the style.css. Is it in Attachments? I can find this bit of code but not sure how to alter it in my child theme to make it do what I want - which is no metadata and smaller h1 title.

    /* =Attachments
    ----------------------------------------------- */
    
    .image-attachment div.attachment {
    	background: #f9f9f9;
    	border: 1px solid #ddd;
    	border-width: 1px 0;
    	margin: 0 -8.9% 1.625em;
    	overflow: hidden;
    	padding: 1.625em 1.625em 0;
    	text-align: center;
    }
    .image-attachment div.attachment img {
    	display: block;
    	height: auto;
    	margin: 0 auto 1.625em;
    	max-width: 100%;
    }
    .image-attachment div.attachment a img {
    	border-color: #f9f9f9;
    }
    .image-attachment div.attachment a:focus img,
    .image-attachment div.attachment a:hover img,
    .image-attachment div.attachment a:active img {
    	border-color: #ddd;
    	background: #fff;
    }
    .image-attachment .entry-caption p {
    	font-size: 10px;
    	letter-spacing: 0.1em;
    	line-height: 2.6em;
    	margin: 0 0 2.6em;
    	text-transform: uppercase;
    }

    Thanks so much.

  10. savedave
    Member
    Posted 1 year ago #

    It's only this "attachment" type of page/post I want to alter

  11. paulwpxp
    Font hero
    Posted 1 year ago #

    That is a totally different issue, you should open new topic for it. For the issue of "Gallery orders not working how they should", please continue in here.

  12. savedave
    Member
    Posted 1 year ago #

    ok thanks...

    not even sure what to call that issue!

    thanks so much for your help on the gallery order issue though. :) Much appreciated

Topic Closed

This topic has been closed to new replies.

About this Topic