最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

hooks - Changing header logo href for the checkout page

programmeradmin4浏览0评论

I am trying to change the href of the logo to a specific custom URL other than the homepage for checkout page.

I have tried few methods including the one shown below but did not work :

add_filter( 'generate_logo_href','generate_add_custom_logo_href' );
function generate_add_custom_logo_href()
{
if  ( is_checkout()) {
        return '';
   }
    else {
    return '/';
    }
}

This is the block of the logo. I am trying to change the href associated with the anchor tag :

    <div id="logo" class="flex-col logo"> <!-- Header logo -->
    <a href="" title="Title" rel="home">
        <img width="213" height="89" src="https://custom/wp-content/uploads/2019/09/Logo1.svg" class="header_logo header-logo" alt="text">
        <img width="213" height="89" src="https://custom/wp-content/uploads/2019/09/Logo2.svg" class="header-logo-dark" alt="text">
</a>

</div>

Is there any other hooks specifically for this purpose? I am using flatsome theme.

发布评论

评论列表(0)

  1. 暂无评论