Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
想在wordpress主页上显示每个活动吗_Wordpress - Fatal编程技术网

想在wordpress主页上显示每个活动吗

想在wordpress主页上显示每个活动吗,wordpress,Wordpress,我想在我的word press主页上显示所有与网站相关的活动。指任何用户注册或评论将显示在主页上的任何帖子。我目瞪口呆,但我认为我没有找到相关的解决办法 任何帮助都将不胜感激。您找不到任何解决方案,因为您的要求非常广泛,取决于您真正想要什么 一般来说,您必须使用,或 对于您特别询问的两个示例: 对于用户注册: add_action( 'user_register', 'myplugin_registration_action', 10, 1 ); function myplugin_regis

我想在我的word press主页上显示所有与网站相关的活动。指任何用户注册或评论将显示在主页上的任何帖子。我目瞪口呆,但我认为我没有找到相关的解决办法


任何帮助都将不胜感激。

您找不到任何解决方案,因为您的要求非常广泛,取决于您真正想要什么

一般来说,您必须使用,或

对于您特别询问的两个示例:

对于用户注册

add_action( 'user_register', 'myplugin_registration_action', 10, 1 );

function myplugin_registration_action( $user_id ) {

    // here you put the funtion that you want ....

}
add_action('wp_insert_comment','comment_inserted',99,2);

function comment_inserted($comment_id, $comment_object) {
    if ($comment_object->comment_parent > 0) {
        //do what you want ..
    }
}
详情如下:

对于注释插入

add_action( 'user_register', 'myplugin_registration_action', 10, 1 );

function myplugin_registration_action( $user_id ) {

    // here you put the funtion that you want ....

}
add_action('wp_insert_comment','comment_inserted',99,2);

function comment_inserted($comment_id, $comment_object) {
    if ($comment_object->comment_parent > 0) {
        //do what you want ..
    }
}
详情如下:

基本上,在这些函数中,您必须在数据库中的某个位置为最新的操作设置一些标志,然后在主题中调用它。。
有很多方法可以做到这一点,但基本上,就像我之前所说的,这取决于你想要什么的细节和细节

在询问之前,你需要努力寻找解决方案,wordpress有自己的支持论坛,可以搜索,但我认为你会在他们自己的帮助页面中找到解决方案,例如,可以通过小部件或插件来完成。下面是对SO上海报的预期——假设我想展示bbpress活动,这可能吗?