0

在自定义用户选项卡中,我试图显示该用户的帖子。(显示的用户,未登录的用户)。

我在论坛上找到了这段代码,但它对我不起作用。它应该只拉“显示用户”的帖子,而不是显示所有帖子。

<?php 
global $bp; 
query_posts( 'author=' . $bp->displayed_user->id ); if (have_posts()) :  

?>

我究竟做错了什么?

万分感谢!

4

1 回答 1

0

I was looking for the same thing, and thank you with your piece of code, it works for me now :) I have the other piece of the puzzle : find bp_core_functions.php in your buddypress plugin folder, and add this :

function bp_dump() {
    global $bp;

    foreach ( (array)$bp as $key => $value ) {
        echo '<pre>';
        echo '<strong>' . $key . ': </strong><br />';
        print_r( $value );
        echo '</pre>';
    }
    die;
}
add_action( 'wp', 'bp_dump' );

That's all.

于 2012-05-24T09:18:10.290 回答