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

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

Alchemy Lab
Participant

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.

#133071

Nayeem Riddhi
Moderator

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

Thanks.

#133073

Alchemy Lab
Participant

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?

#133102

Nayeem Riddhi
Moderator

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.