OK, I don’t really know how to do trial and error coding here, and as I’m currently doing it, it is very inefficient. I type in Code Snippets and if things go south it reverts to the last save. I’m not gonna bother you over and over, but maybe you could just set me on the right path to get a result whatsoever and I’ll go digging some after that. I’m used to coding, just not php, and especially not in a wordpress environment with a web-gui editor. xD
I see this code (copy pasta further down), and I believe this could be (at first) hardcoded with a download category ID. I installed the plugin and can see that the category ID is represented in the dropdown list in the widget area. I see $instance[‘download_category_id’] and go “aha, I can just insert it there!”
I tried with both int and string, but foreach-echoing the results breaks the page.
I have the feeling that if I just understand this part, the rest will fall into place with a bit of determination, but I think I need a push to keep the motivation going.
$lana_downloads = get_posts( array(
'post_type' => 'lana_download',
'numberposts' => - 1,
'tax_query' => array(
array(
'taxonomy' => 'lana_download_category',
'field' => 'id',
'terms' => $instance['download_category_id'],
'include_children' => false
)
)
) );