dongxibeng5324 2015-06-04 11:27
浏览 13

仅在店铺Wordpress上显示标题

Took me some time to find out a working code to show the header above the sidebar.
But I now have the problem that I just want to show the header on the shop-page and not on the product pages.
So I'm trying to figure out what do I need to change?

add_action('woocommerce_before_main_content','before_main_content');

function before_main_content() { ?

<img src="image url">

<?php
}
?

Thank you guys for all the answers :) This one worked for me :

function before_main_content() { 
if (is_shop()) { 
?>
<img src="image url">

<?php
}
}
?>
  • 写回答

2条回答 默认 最新

  • duan97689 2015-06-04 11:32
    关注

    Replace *** with your shop page name:

    <?php 
        if ( is_page('***')) { 
            **Insert your header code here**; 
        } 
    ?>
    

    This works for me :)

    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号