简体   繁体   English

PHP将首页徽标链接到首页(来自wordpress.org的预制主题)

[英]PHP link homepage logo to home (premade theme from wordpress.org)

I have researched and looked into the forums already but none seem to be faced with what I'm dealing with. 我已经研究并调查了这些论坛,但是似乎没有人面对我正在处理的问题。

I'm trying to link my company's logo to the home page...but when I inspect the logo element it says it's already linked to the home page but the logo isn't clickable. 我正在尝试将公司的徽标链接到主页...但是当我检查徽标元素时,它说它已经链接到主页,但是徽标不可单击。

I've looked into functions and I can't find "business_kit_the_custom_logo" 我研究过函数,但是找不到“ business_kit_the_custom_logo”

Below is header.php regarding the logo and site branding. 以下是关于徽标和网站品牌的header.php。 link to site is: https://curvetrace.testfixtures.com/ 指向网站的链接是: https : //curvetrace.testfixtures.com/

 <div class="bottom-header">

        <div class="container">

            <div class="site-branding">

                <?php echo business_kit_the_custom_logo(); ?>

                <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>

                <?php
                $description = get_bloginfo( 'description', 'display' );

                if ( $description || is_customize_preview() ) : ?>

                    <p class="site-description"><?php echo $description; /* WPCS: xss ok. */ ?></p>

                    <?php
                endif; ?>
            </div><!-- .site-branding -->

The paragraph with the class "site-description" is overlapping your logo, so when you click the logo you're actually clicking that paragraph. 具有“网站描述”类的段落与您的徽标重叠,因此,当您单击徽标时,您实际上是在单击该段落。 Hover your mouse over the bottom half of your logo and you can see that it is indeed clickable where the paragraph doesn't overlap it. 将鼠标悬停在徽标的下半部分,您会发现在该段落不重叠的地方确实可以单击它。 If you disable the styles for that paragraph your whole logo and the text above that paragraph are clickable. 如果禁用该段落的样式,则可以单击整个徽标和该段落上方的文本。 See image. 见图片。 在此处输入图片说明

The sites .site-description paragraph is overlapping the content: 网站.site-description段落与内容重叠:

在此处输入图片说明

to fix this, change this style: 要解决此问题,请更改此样式:

.site-description {
    padding-left: 31px;
    font-size: 22px;
    left: 16px;
    margin-left: -18px;
    position: relative;
    top: 0px;
}

to this: (Note that I've used a left padding of 114px to re-align the P element). 为此:(请注意,我使用了114px左填充来重新对齐P元素)。

.site-description {
    padding-left: 114px;
    font-size: 22px;
}

Now, for mobile responsive, I've changed the padding-left to 24px and overridden the default padding using !important and removed again the positioning styles: 现在,对于移动响应,我将padding-left更改为24px并使用!important覆盖了默认的padding并再次删除了定位样式:

@media screen and (max-width: 551px)
{
    .site-description {
        padding-left: 24px !important;
        float: left;
        font-size: 20.5px !important;
        font-family: garmond;
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Wordpress.org中发送PHP变量的值 - Send values for a PHP variable in Wordpress.org 加密需要上传到wordpress.org的WordPress主题文件 - Encrypt WordPress theme files that need to be uploaded to wordpress.org 我的wordpress.ORG主题破坏了评论功能 - My wordpress.ORG theme breaks comments functionality 如何使用WordPress Avada子主题将主要徽标的链接更改为自定义URL而不是首页? - How to change link of main logo to custom URLs instead of homepage, with WordPress Avada child theme? 使用WordPress Avada子主题将主徽标链接到自定义URL而不是首页? - Link main logo to custom URLs instead of homepage, with WordPress Avada child theme? 样式/插件后图像从页面中消失空白空间[Wordpress.org localhost, PHP, HTML, CSS} - Images disappeared from page after styling / plugins Empty space [Wordpress.org localhost, PHP, HTML, CSS} 如何阻止 Wordpress 尝试使用 Wordpress.org 上的主题更新我的主题 - How to stop Wordpress trying to update my theme with a theme on Wordpress.org 如何使我的徽标链接回到wordpress二十二子主题中的首页? - How do I make my logo link back to home page in wordpress twenty twelve child theme? 格式化Wordpress主题中的PHP生成的HTML,用于站点文本徽标 - Formatting HTML generated from PHP in Wordpress theme for site text logo Wordpress,PHP-将图像插入主题主页 - Wordpress, PHP - Inserting Image Into Theme Homepage
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM