duanmiao6695 2014-05-02 13:11
浏览 22
已采纳

如何在wordpress中的特定页面中显示水平线?

        /*I am using the wordpress i designed about ,contact and subscribe page.i want to display banner image  for about and contact page, i don't want it in subscribe page instead of that i want put horizontal line after the header logo section */

        //like this my display in about and contact page
        <header>
         <logo section>

         <Banner section>
        </header>
        <body>
         <content section>
        </body>

        //in subscribe page

        <header>
         <logo section>

         <hr></hr>
        </header>
        <body>
         <content section>
        </body>

        //code is below

        <?php if ( !is_page('subscription') ) {  ?>

 <div class="linebar" style="width:100%;border-bottom: 4px solid rgb(238, 238, 238);">   </div>
<?php } ?> 

                    <div class="header-cover section bg no-padding">

                        <div class="header section" style="background:#ecbf0c">



                             <div class="header-inner section-inner"> 


                            </div>  <!-- /header-inner -->

                        </div> <!-- /header -->

                    </div> <!-- /bg-dark -->

                    <div class="navigation section no-padding bg-dark">

                        <div class="navigation-inner section-inner">

                            <div class="toggle-container hidden">

                                <div class="nav-toggle toggle">

                                    <div class="bar"></div>
                                    <div class="bar"></div>
                                    <div class="bar"></div>

                                    <div class="clear"></div>

                                </div>

                                <div class="search-toggle toggle">

                                    <div class="metal"></div>
                                    <div class="glass"></div>
                                    <div class="handle"></div>

                                </div>

                                <div class="clear"></div>

                            </div> <!-- /toggle-container -->

                            <div class="blog-search hidden">

                                <?php get_search_form(); ?>

                            </div>




    </div>
</div>

    /*this my code so help to resolve my problem i want to display the horizontal line in the subscribe page .*/

//first logo section that contains the left side logo and right side menus 

//next hr line then i want to display subscribe form 

/*so please help me to solve this problem  .i don't know where to place the php code to hide the content in for particular page instead of that add the new content for that */

// i have mentioned the code above

//i want to display the horizontal line or the content on that place

/*so please help me to solve this problem  .i don't know where to place the php code to hide the content in for particular page instead of that add the new content for that */

// i have mentioned the code above

//i want to display the horizontal line or the content on that place

  • 写回答

1条回答 默认 最新

  • doutun9179 2014-05-02 13:29
    关注

    if you want it to display on when

    <?php if ( !is_page('subscription') )
    echo '<div class="linebar" style="width:100%; border-bottom: 4px solid rgb(238, 238, 238);"></div>';
    ?>
    

    try that..

    assuming you want a div to display when something is true, you do this

    '; that will display div is e is true and echo no if e is false. ?>
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 怎样才能让鼠标沿着线条的中心线轨迹移动
  • ¥60 用visual studio编写程序,利用间接平差求解水准网
  • ¥15 Llama如何调用shell或者Python
  • ¥20 谁能帮我挨个解读这个php语言编的代码什么意思?
  • ¥15 win10权限管理,限制普通用户使用删除功能
  • ¥15 minnio内存占用过大,内存没被回收(Windows环境)
  • ¥65 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?