Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.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 magento集成后在帖子/主页中显示作者头像_Wordpress_Magento - Fatal编程技术网

wordpress magento集成后在帖子/主页中显示作者头像

wordpress magento集成后在帖子/主页中显示作者头像,wordpress,magento,Wordpress,Magento,我正在使用FishPig扩展将wordpress集成到magento中,一切正常。。现在我想在每篇文章中显示作者gravatar&在主页上,在每篇文章的标题下显示一个小的作者图像。这里是博客url-www.postmygreetings.com/blog/ 编辑: 我正在使用此代码在主页上的每个帖子下显示作者姓名、发布日期和标签,现在我还想显示小作者图像: <?php echo stripslashes($this->__('This entry was posted in %s a

我正在使用FishPig扩展将wordpress集成到magento中,一切正常。。现在我想在每篇文章中显示作者gravatar&在主页上,在每篇文章的标题下显示一个小的作者图像。这里是博客url-www.postmygreetings.com/blog/

编辑:


我正在使用此代码在主页上的每个帖子下显示作者姓名、发布日期和标签,现在我还想显示小作者图像:

<?php echo stripslashes($this->__('This entry was posted in %s and tagged %s on %s<span class=\"by-author\"> by %s</span>.', 
         $this->getCategoryString($post), 
         $this->getTagString($post), 
         $post->getPostDate(), 
         $post->getAuthor()->getDisplayName())
  ) ?>

要获得用户的头像,你必须创建一个类似于wordpress的功能,你可以找到它的功能

完成此函数后,只需使用正确的参数调用它,它应该可以工作

从已经可以使用的对象中获取参数,如

$post->getAuthor()->getDisplayName())


你能分享你想让gravatar显示的代码吗?请在其中包含你用来获取文章标题的代码,获取作者的图像是相似的。我正在使用此代码显示作者姓名,主页上每篇文章下的发布日期和标签现在我还想显示小作者图像
,你知道在wordpress magento集成后在哪里添加新功能吗,因为wp文件夹中的默认funvtions.php文件不起作用?@SatinderSingh我不知道确切情况,但检查是什么函数给$post变量赋值检查它在哪里是,看看是否可以将自定义函数放在那里(以及它是否位于正确的位置…)