我是WordPress的新手,我正在尝试应用一些面向对象的知识,这让我陷入困境,寻求你的帮助。
我创建了一个注释类:
<?php
class Comments {
public $commentSection;
public function getComments() {
//Get only the approved comments
$args = array(
'status' => 'approve'
);
$comments_query = new WP_Comment_
我试图在wordpress用户头像下添加一些数据,我使用的是add_filter get_avatar,它没有显示任何内容。我错过了什么?
<?php
add_filter( 'get_avatar' , 'my_custom_avatar' , 1 , 1 );
function my_custom_avatar( $avatar ) {
//if I use echo, it works
$data='<p>Genius</p>';
retu
我正在使用:
echo get_avatar(get_the_author_id(), 30);
不过,我还是要用这个通知:
echo get_avatar(get_the_author_meta(), 30);
它不显示作者Gravatar图像,只显示Gravatar默认图像。
**Notice:** get_the_author_ID is deprecated since version 2.8! Use get_the_author_meta('ID') instead. in C:\Users\Administrator\Desktop\www.wpsites.dev