• Resolved carlopantaleo

    (@carlopantaleo)


    Greetings!
    I’m using the plugin on an ad site and I would like to count the number of ads in each category. The ads plugin is Directorist – Business Directory Plugin. Is it possible to do this with your plugin? For example, if the ad category ID is 53, how should I set the shortcode?

    Thanks in advance for your help…

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Glad to help.

    So the “ads” are regular WP posts, correct?

    Just want to make sure so I can provide accurate information, thank you.

    • This reply was modified 3 weeks, 4 days ago by Jeff Starr.
    Thread Starter carlopantaleo

    (@carlopantaleo)

    Thanks for the quick reply.
    In reality, the ads are managed by the Directorist – Business Directory Plugin. It is possible to manage ads by dividing them into categories.
    Among other things, by doing some tests, I saw that your plugin was able to count the total number of ads and other informations.

    Exemple: With ths shortcode [sbs_cpts_count] gives these informations

    • 3 Template
    • 13 Listings
    • 0 Ordinamento
    • 1 Pagina di MailPoet
    • 1 Template

    What I would like to do is simply count the number of ads for each category. I hope I was clear…

    Plugin Author Jeff Starr

    (@specialk)

    Ok so if I understand correctly you can display your CPT count like this:

    [sbs_cpt_count cpt="template"]

    Replace “template” with the id/slug of your CPT.

    This is documented here with more details, just fyi.

    I hope this helps, let me know if I can provide any further information.

    Thread Starter carlopantaleo

    (@carlopantaleo)

    As you can see in the image, using the slug does not work (the “Biostimolanti” category actually contains 4 listings). I tried even with the ID, but nothing. In black you can see the father-category, in green all the under-categories. Could this be a problem?

    Plugin Author Jeff Starr

    (@specialk)

    Glad to help.

    In your previous comment you said that [sbs_cpts_count] (which only works with custom post types) is working to display the list of counts for your custom post types. So in my reply, I assumed that you were trying to display counts for custom post types. That is why I mentioned the [sbs_cpt_count cpt="template"] shortcode, which only works with custom post types.

    But now in your follow up comment, you are calling them “categories” (i.e., the “Biostimolanti” category), so I am confused. Both of the shortcodes that I mention previously in this comment work only with custom post types. So if you want to display counts for categories instead, try this:

    [sbs_posts cat="CAT_ID"]

    Replace “CAT_ID” with the actual category ID. Again this is explained in the plugin documentation with more details, just fyi.

    • This reply was modified 3 weeks, 3 days ago by Jeff Starr.
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.