WordPress.org

Ready to get started?Download WordPress

Forums

Media Library Assistant
[resolved] mla_gallery category= not limiting to the category. (7 posts)

  1. LVRuss
    Member
    Posted 8 months ago #

    Just started using the plugin and it's going to really make doing what I want to do a lot easier. I'm building a genealogy site (PerryFamilyRoots.com) using the rootsPersona plugin. All has been going well but for some reason "mla_gallery category=" with "post_parent=current" is showing all the images with the current page as parent, not just those in the specified category.
    More detailed: I have a page for Census reports (http://www.perryfamilyroots.com/WP/?page_id=15218) and a category for each census year
    Name Slug Pages
    1790 Census 1790-census 0
    1800 Census 1800-census 0
    1810 Census 1810-census 0
    etc.
    I'm using the WP UI plugin with tabs for each census year.
    [wptabs]
    [wptabtitle] 1790[/wptabtitle]
    [wptabcontent]
    [mla_gallery category='1790-census' post_parent=current]
    [/wptabcontent]
    [wptabtitle] 1800[/wptabtitle]
    [wptabcontent]
    [mla_gallery category='1800-census' post_parent=current]
    [/wptabcontent]
    [wptabtitle] 1810[/wptabtitle]
    [wptabcontent]
    etc.
    ...
    [/wptabs]
    I'm using the Mantra theme, the Post Tags and Categories for Pages plug in to add categories to all the "page" posts (no "post" post are being used), I'm not using tags (yet.)
    Am I doing something wrong? Could another plug in be causing the problem?

    http://wordpress.org/plugins/media-library-assistant/

  2. LVRuss
    Member
    Posted 7 months ago #

    One other thing just noticed. Bulk edit to add parent page results in "no change detected" message and doesn't add parent. Bulk edit to add category works great.

  3. LVRuss
    Member
    Posted 7 months ago #

    Ok found the solution. Not very clear on the documentation page but you have to include "tax_operator=AND" otherwise it apparently defaults to "OR". Apparently quotes around the category SLUG are optional also.

  4. David Lingren
    Member
    Plugin Author

    Posted 7 months ago #

    Thanks for the good words about the plugin and for this question. Thanks especially for the link to your site, which is fascinating!

    I completed some testing before I saw your last two updates. I also had trouble with the Bulk edit action and discovered that it only modifies the first item on the list. You have found an MLA bug, which I will fix in my next release; thank you!

    The tax_operator fix you found doesn't work for the reason you think and, in fact, only works sometimes (it didn't work for me).

    The real solution is buried in the WordPress Codex documentation for the WP Query Class, in Section 5.2 Category Parameters.

    Categories and Tags go way back in WordPress, and the syntax for them is different from the more recent custom taxonomies. In your case, the parameter should be category_name='1790-census'. That's how you specify a slug/name in the Categories taxonomy.

    The category_name parameter works for me and is the official way to accomplish your goal. Give it a try and let me know if you have any further problems or questions.

    I will leave this topic unresolved until I fix the bug you found in the Bulk edit action. Thanks again for your interest.

  5. LVRuss
    Member
    Posted 7 months ago #

    Thanks for the rapid reply. I'm going to try the "mysterious" category_name requirement now and will let you know how it works out.

  6. LVRuss
    Member
    Posted 7 months ago #

    It works! Thanks again.

  7. David Lingren
    Member
    Plugin Author

    Posted 7 months ago #

    That's great - thanks for confirming my suggested solution. I'm going to mark this issue resolved. Please let me know if you have any problems or further questions.

Reply

You must log in to post.

About this Plugin

About this Topic