css - 如何在wordpress中更改网站特定页面上的徽标?
问题描述
我在 wordpress 的网站上工作。
我使用任何插件搜索了一个问题,即我希望在我的网站的一个页面中使用不同的徽标,但我没有找到令人满意的解决方案。
请有人告诉我如何做到这一点,主要标志应该出现在整个网站上,而辅助标志应该出现在我网站的一页上
解决方案
您可以使用该is_page()
方法检查您所在的页面并相应地更改徽标。
因此,在标题或显示徽标的位置,您将这样做:
<?php
//Returns true when the Pages displayed is either post ID = 42, or post_name is "about-me", or post_title is "About Me And Joe".
if(is_page( array( 42, 'about-me', 'About Me And Joe' ) ) )
{
//display the secondary logo
}
else
{
//display the main logo
}
当然,我在这里假设您希望它与众不同的页面是 WordPresspage
如果它是列表页面或单个帖子页面,那么您可以使用不同的检查方法。所有这些都在这里描述。
推荐阅读
- angular - Angular 5 儿童路由器插座不起作用
- python - 使用 seaborn 的密度图
- directx - 为什么精灵渲染对象?
- angular - Firestore 在订阅之外获取 UID
- python - 如何在熊猫数组python的每个元素上应用一个函数
- python-3.x - plot_decision_regions 错误“当 X 具有超过 2 个训练特征时,必须提供填充值。”
- c++ - 范围解决优先级
- excel - 等到 Excel 完成使用 VBA 填充 Bloomberg 数据
- html - 定位/调整背景图像的问题
- c# - 检查具有未知级别的嵌套列表中的属性值