• Resolved cristiano771

    (@cristiano771)


    Hi,
    I am using MLA_GALLERY for my website. I have thousands of pictures. With this plugin I have created several categories and sub-categories (using attachment_category) to show each type of my photos. Everything is going very well.
    Now, I’d like to add a text string on top of my pages that could indicate the number of pictures attached to that category. I tried with MLA_TERM_LIST but I cannot filter the output, so it shows all the categories and not each one.

    This is my shortcode:
    CODE
    [mla_term_list taxonomy=attachment_category mla_output=flat show_count=true number=1]

    Can I filter in any way the output? Or any other solution… thanks a lot.

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

    (@dglingren)

    Thanks for your question. Thanks as well for posting the text of your shortcode; very helpful.

    You can achieve your goal by replacing the number=1 parameter with an include= parameter. For example:

    [mla_term_list taxonomy=attachment_category mla_output=flat show_count=true include=2402]
    

    In the above example “2402” is the term ID of the desired term. You can find the term ID by going to the Media/Att. Categories screen, hovering over (or clicking on) the “Edit” link in the Name column and finding the “tag_ID=” value.

    You can add link=none to eliminate the hyperlink tag surrounding the item text. You can use the mla_link_text parameter to customize the contents.

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

    Thread Starter cristiano771

    (@cristiano771)

    Thank you so much for the answer. It works fine.

    However I am now using a custom code snippet with a php function called by a custom shortcode. In this way I can eliminate the “( )” and the name of the term.

    I had just a little trouble with terms such as “Cavaliere d’Italia” because the count was zero… so I have renamed the term as “Cavaliere d-Italia”.

    Thank you again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add a text with number of item (of attachment_category)’ is closed to new replies.