Hide a block of code if there are no files to download

in Download Manager Free

Viewing 4 posts - 1 through 4 (of 4 total)
Jul 20, 2020 at 8:59 am
#133066
Participant
Alchemy Lab
OP

Hi to all,

I’m wondering if is there a way to check if are there any file for a category/tag and show a block of code only if there are some files to show.

In plain English:

[check if there are some file in the “catalogue” category: if true, show the following code]

<h4>Catalogues</>
[wpdm_category id="catalogue" tags="downloadable" toolbar="0" order_by="Date" order="desc" paging="0" cols=1 colspad=1 colsphone=1 template="link-template-default"]

[end check]

The goal is to hide the title if there isn’t any file to download.

Any hint? Thanks in advance.

Jul 20, 2020 at 9:42 am
#133071
Moderator
Nayeem Riddhi
Staff

You can check it with the PHP. the templates are supporting PHP language too. but, you have to do it in the editor.

Thanks.

Jul 20, 2020 at 9:59 am
#133073
Participant
Alchemy Lab
OP

Thanks for the reply… I’m in the template, what have I exactly to do? A MySQL query or there is a wpdm function to trigger?

Jul 20, 2020 at 4:37 pm
#133102
Moderator
Nayeem Riddhi
Staff

You have to put just a condition based on an if-else statement if you know the PHP

Thanks.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic "Hide a block of code if there are no files to download" is closed to new replies.