[downloads] shortcode – loop for empty
-
Hi,
I gone wild and created own tree for downloads (see Dokumenty).
It looks like:
'[downloads category="'. $category['slug'] .'" category_include_children="false" template="button" loop_start="<div class=\'download-category\'><'. $tag .'><a href=\''. get_permalink() . $category['slug'] .'/\'>'. $category['name'] .'</a></'. $tag .'>" loop_end="'. htmlspecialchars($children) .'</div>" before="" after="" ]'
Where:
$category
is current category (from friendly URL).$tag
is hierarchical number for header.$children
is calling to itself of function –$children = ( count( $category['children'] ) ? print_categories( $category['children'], $i_tag + 1 ) : '' );
.
I have one of main category, which have nothing in itself – Pozosta?e pliki – however childrens have, for example Pozosta?e 2011/2012
As you can see they appears in dropdown and files’ main page as I set
'hide_empty' => false,
for queries.
Can I set something similar to[downloads]
shortcode, as I don’t see anything related in documentation (category_include_children
don’t do the job as then files are cloned under parent and children)?
As summary – I need toloop_start
andloop_end
were executed depending not on if certain category is empty of files.(Maybe I could check for source code for myself, but I will fall asleep in a moment and maybe above code will be useful for future readers.)
Thanks in advance,
Greetings
- The topic ‘[downloads] shortcode – loop for empty’ is closed to new replies.