网站徽标(如果是主页)并发布缩略图(如果是单身).. facebook 和 wordpress

发布于 2024-12-26 13:00:46 字数 425 浏览 0 评论 0原文

我希望我的 WordPress 网站显示我的网站徽标(如果是主页或自定义页面),否则如果是单个页面,则应在 facebook 上显示帖子缩略图。 通过描述我必须这样做,但在 php 中我不知道我做错了什么 这是描述代码:

<?php
    if(is_home||is_page(array('oktato-videok','cikkek','hol-csajozz','hol-randizz','galeria','treningek')))
    {
        echo "This is the default wordpress descrition";
    }
    else
    {
        echo wp_title();
    }
?>

如果您可以帮助描述,我可以自己进行足够的更改。

多谢!

I want my wordpress site to show my site logo if is home or a custom page, else if is a single it should show the post thumnnail on facebook.
And with description I have to do it but in php I don't know what did I do wrong
Here's the code of description:

<?php
    if(is_home||is_page(array('oktato-videok','cikkek','hol-csajozz','hol-randizz','galeria','treningek')))
    {
        echo "This is the default wordpress descrition";
    }
    else
    {
        echo wp_title();
    }
?>

If you could help on the description I can make the sufficient changes on my own.

Thanks a lot!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一片旧的回忆 2025-01-02 13:00:46

is_home 是一个函数,因此应该像 is_home() 一样编写。

Wordpress Codex 链接:http://codex.wordpress.org/Function_Reference/is_home

is_home is a function and should therefore be written like is_home().

Link to the Wordpress Codex: http://codex.wordpress.org/Function_Reference/is_home

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文