Ever tried this?
// template file
do_action( 'my_hook' );
// ex. functions.php
function my_hooked_template_part() {
get_template_part( 'my_loop_part_file', 'default' );
}
add_action( 'my_hook', 'my_hooked_template_part' );
// my_loop_part_file-default.php
get_template_part( 'query', 'default' );
if ( have_posts() ) {
while ( have_posts() ) : the_post();
etc.
// query-default.php
get_posts( array( 'whatever' => 'and_so_on', ) );
Maybe it's my setup, but it won't load the file. Could it be that it's too late for loading some other file inside? Can anyone confirm or this just a drawback of using the get_template_part() function (only one file - no nesting)?
var_dump(__FILE__)
to each file, can you see that output?wp_cron_bla
notice I get from time to time in my local setup. Thanks for your help guys!