Hi,
i need to create a page passing a parameter to view some manuals
I’ve made this script and it works fine to show all files, but i don’t know how to view subcategory for each file
In particular: i have to show all manuals of a product (my category), but they are in more languages (my subcategories) and i want a view like
Product
Language 1
Files language 1
Language 2
Files language 2
My script now is this, i have only to add subcategories but i dont’ know how to do
/** MANUALI ENG ********************************************************/
public function createDocumentListsManualEng( $atts, $content = null ) {
$terms = $atts['product_slug'];
$loop1 = new WP_Query( array( 'post_type' ► 'wpdmpro',
'tax_query' ► array(
array (
'taxonomy' ► 'wpdmcategory',
'field' ► 'slug',
'terms' ► $terms,
)
), 'posts_per_page' ► -1 ) );
$html = '<div id="inno-docs">';
if( $loop1->have_posts() ) {
$html .= '<div class="inno-doc"><h3>MANUALS ' . $terms . '</h3><ul class="inno-scrollable">';
while( $loop1->have_posts() ) {
$loop1->the_post();
$html .= '<li><a href="' . wp_get_attachment_url( get_post_meta( get_the_ID(), 'documento_allegato', true ) ) . '" target="_blank">' . get_the_title() . '</a></li>';
}
$html .= '</ul></div>';
wp_reset_postdata();
}
return '<div id="inno-logged-in">'.$html.'</div>';
}