I have a template part like this:
<nav id="subpagemenu" class="sidebar"> <?php get_template_part( 'nav', 'subset' ); ?> <?php get_sidebar(); ?> </nav>
Both of these are conditional, I mean, nothing will load if there's no content. if there is content, they both load boxes like:
Now I would like to be able to know if there are any widgets (sidebar, or my template_part), so that in my functions.php, I can set a variable $mywidgets=true or false.
I know that I can use '_is_active_sidebar' for the one part, but how can I check the other part? I don't want to register that part as a sidebar... All I need is a 'true/false'.
I tried 'is_page_template' and 'set_theme_mod'. I also looked at these threads:
Am I thinking of this in the wrong way? Need to construct the theme differently?