简体   繁体   English

停止特定 <div> 仅出现在一页上

[英]Stop a particular <div> appearing on just one page

I was wondering could you help me, we currently have an announcement banner across the top of all our webpages which I want to remain apart from one page. 我想知道您能不能帮到我,我们目前在所有网页的顶部都有一个公告横幅,我想保持一页的间隔。 A couple of guys did a bit of work for me a put an announcement in which I can edit via Custome Content Type Manager on Wordpress. 几个人为我做了一些工作,发布了一个公告,其中我可以通过Wordpress上的Custome Content Type Manager进行编辑。

In the Header.php the code is there and I'm not sure how to get it to stop appearing on a particular page, the id of the page I DONT want it on is 2664. The code is shown below: 在Header.php中,代码在那里,并且我不确定如何使其停止出现在特定页面上,我不想让它进入的页面的ID是2664。代码如下所示:

<?php  
            $gathering_page = get_the_ID();
            if( ($gathering_page == 3001 || $gathering_page ==2664) && !(is_front_page()) ){ ?>

I'm not sure if the guys have tried to block it or what this code means. 我不确定这些家伙是否试图阻止它或此代码的含义。

Any feedback would be appreciated. 对于任何反馈,我们都表示感谢。 Thanks 谢谢

EDIT: This may make it easier; 编辑:这可能使它更容易; I would like to make a div class disappear on the page named above. 我想在上面命名的页面上使div类消失。 the div class is div类是

        <div class="snippetHomeTop"> 

I'm sorry if I did wrong, but have you tried using the is page? 很抱歉,如果我做错了,但是您是否尝试过使用is页面?

      <?php if (is_page('2664')) {
       // don´t show content for page ID 2664
       } else {
       // show content for other pages
       }?>

Good Luck 祝好运

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM