• Resolved cristiano771

    (@cristiano771)


    Hi!
    I am going crazy… in all my pages the code works perfectly, but not with this one: link

    Here the browser does not shows the paginate links… could you help me?

    The code of the page:

    [numero-specie-pag categoria="Airone guardabuoi"]
    [mla_gallery columns=0 mla_style="responsive" size="medium" my_custom_sql="attachment_category='Airone guardabuoi' orderby=date order=DESC"  posts_per_page=30 mla_link_href='/visualizza-specie/?current_id={+attachment_ID+}&specie={+parent+}&title={+parent_title+}&attachment_category=Airone guardabuoi']
    
    <div style="clear: both; text-align: center; color: #333;">[mla_gallery attachment_category="Airone guardabuoi" posts_per_page=30 mla_output="paginate_links,prev_next"]</div>

    The code is the same of each gallery page of my site. In each page the name of the attachment category changes, but if it was not correct in this I could not see the photos of the gallery and the total count of images…

    I hope you can help me with this issue…
    Cristiano

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author David Lingren

    (@dglingren)

    Good to hear from you again, and thanks for your question. Thanks especially for including the full text of your shortcodes; very helpful.

    To make pagination work in synchronization with a gallery display the data selection parameters of both shortcodes must be identical. Your gallery shortcode contains my_custom_sql="attachment_category='Airone guardabuoi' orderby=date order=DESC", but the pagination shortcode has a slightly different attachment_category="Airone guardabuoi". If you copy the parameter in the gallery shortcode to the pagination shortcode (or the other way around) they will be in synch.

    I went to the page you gave a link to and had a look. I count 29 items in the gallery display. Since this is less than the posts_per_page=30 value, no pagination controls will be displayed. I also see that the page lists “39 immagini” so I imagine you are expecting more images in the gallery. I cannot account for the difference; you will have to investigate further to resolve it. It’s possible that the [numero-specie-pag categoria="Airone guardabuoi"] shortcode is looking in a different taxonomy than the [mla_gallery] shortcodes.

    I am marking this topic resolved, but please update it if you have any problems or further questions regarding the suggestions above. Thanks for your continuing interest in the plugin.

    Thread Starter cristiano771

    (@cristiano771)

    Hi David,
    thank you so much for the answer. I solved the issue with this code that now works fine (using the slug of the category and not the name):

    [numero-specie-pag categoria="Airone guardabuoi"]
    [mla_gallery columns=0 mla_style="responsive" size="medium" my_custom_sql="attachment_category='airone-guardabuoi' orderby=date order=DESC"  posts_per_page=30 mla_link_href='/visualizza-specie/?current_id={+attachment_ID+}&specie={+parent+}&title={+parent_title+}&attachment_category=airone-guardabuoi']
    
    <div style="clear: both; text-align: center; color: #333;">[mla_gallery attachment_category="airone-guardabuoi" posts_per_page=30 mla_output="paginate_links,prev_next"]</div>

    But just two things:
    1) The attachment-category ‘Airone guardabuoi’ has 39 images (the snippet counts in the same taxonomy – if you see now the page you will find two pages, one with 30 images and one with 9 images); I am using this code (my_custum_sql in the gallery and attachment category for pagination in all pages and it works fine!!)

    2) The category ‘Airone guardabuoi’ has this slug: airone-guardabuoi… could be this the problem? Many categories have a name made of two words and a slug with “-” character between the two words… for example this is the code of one other page:

    [numero-specie-pag categoria="passero solitario"]
    [mla_gallery columns=0 mla_style="responsive" size="medium" my_custom_sql="attachment_category='passero solitario' orderby=date order=DESC"  posts_per_page=30 mla_link_href='/visualizza-specie/?current_id={+attachment_ID+}&specie={+parent+}&title={+parent_title+}&attachment_category=passero solitario']
    
    <div style="clear: both; text-align: center; color: #333;">[mla_gallery my_custom_sql="attachment_category='passero solitario'" posts_per_page=30 mla_output="paginate_links,prev_next"]
    </div>

    and this is the url: LINK
    The attachment_category is named “passero solitario” and its slug is “passero-solitario”

    Your plugin is really essential for my site, so I am writing to you even though I have solved the problem – maybe there is something that eludes me anyway!
    Thank you again,
    Cristiano

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update with the good news regarding your solution. Changing from the term name to the term slug was a good thought. In the “Simple Taxonomy Parameters” section of the Settings/Media Library Assistant Documentation tab I found:

    Note that you should use the name/slug strings for taxonomy and terms, not the “title” strings. You can often use the “title” strings if they can be “sanitized” to the slug, but this is not always reliable.

    There is code in MLA to transform the name into a slug and it should have worked in this case, but I will not argue with success.

    Also, my comment about 29 items was wrong; I missed the two small images in the second gallery row. I regret the oversight.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Going crazy with this page and mla_output’ is closed to new replies.