在这里和BuddyPress玩!
我创建了一些新的用户配置文件页面,当我显示内容时,我想进行一个新的帖子查询,并显示循环。
问题是,我想用模板Wordpress来显示循环,他会选择自己-depending on the query, on the theme installed, 等嗯,取决于template hierarchy.
它将是存档{post\\u type}。php,存档。php,索引。php?还有别的吗?
我需要WP返回给我的模板加载。
这有可能吗?怎么可能?
非常感谢!
add_action( \'bp_setup_nav\',\'register_music_menu\', 99 );
function register_music_menu() {
global $bp;
...
bp_core_new_subnav_item( array(
\'name\' => __( \'Playlists\', \'wpsstm\' ),
\'slug\' => WPSSTM_PLAYLISTS_SLUG,
\'parent_url\' => $bp->displayed_user->domain . WPSSTM_BASE_SLUG . \'/\',
\'parent_slug\' => WPSSTM_BASE_SLUG,
\'screen_function\' => \'view_user_static_playlists\',
) );
}
function view_user_static_playlists() {
add_action( \'bp_template_title\', \'user_static_playlists_subnav_title\' );
add_action( \'bp_template_content\',\'user_static_playlists_subnav_content\');
bp_core_load_template( apply_filters( \'bp_core_template_plugin\', \'members/single/plugins\' ) );
}
function user_static_playlists_subnav_content(){
...
//overriding WP Qyery
query_posts( $args );
/*HERE,
I would like to embed a template to display my loop;
and I want this to be the template WP would have chosen based on the query.
In this precise case, it would be the archive template of my custom post type.
But, depending of the user\'s theme; I don\'t know if it will be archive-{post_type}.php, archive.php, index.php...
Well, I just want to get the path WP would have chosen.
*/
locate_template( $template,true,false );
}