douji3623 2013-08-27 10:45
浏览 38
已采纳

删除PHP片断的Wordpress主题导致空白屏幕

I am trying to modify a child theme based on wp-foundation and I'm trying to edit the front page.

This is the front page code in the main theme;

    <?php
/*
Template Name: Homepage
*/
?>

<?php get_header(); ?>

            <div id="content">

                <div id="main" class="twelve columns" role="main">

                    <article role="article">

                        <?php

                        $orbit_slider = of_get_option('orbit_slider');
                        if ($orbit_slider){

                        ?>

                        <header>

                            <div id="featured">

                            </div>

                        </header>


                        <?php } ?>

                        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

                        <section class="row post_content">

                            <div class="home-main eight columns">

                                <?php the_content(); ?>

                            </div>


                        </section> <!-- end article header -->

                        <footer>

                            <p class="clearfix"><?php the_tags('<span class="tags">Tags: ', ', ', '</span>'); ?></p>

                        </footer> <!-- end article footer -->

                    </article> <!-- end article -->

                    <?php 
                        // No comments on homepage
                        //comments_template();
                    ?>

                    <?php endwhile; ?>  



                    </article>

                    <?php endif; ?>

                </div> <!-- end #main -->


            </div> <!-- end #content -->

<?php get_footer(); ?>

Whenever I try to delete some code (I want to get rid of the built in orbit slider and use a plugin for example) but when I delete this piece;

<?php
$orbit_slider = of_get_option('orbit_slider');
                        if ($orbit_slider){

                        ?>

The page just goes blank. I thought I was doing this in a 'clean' way, though I am not so familiar with PHP so I don't get why the page goes blank. I want to delete more of the php codes (basically I want a clean empty page to start with.) but they all give the same result; a blank page.

Why can't I just remove these pieces, why does this error occur?

  • 写回答

2条回答 默认 最新

  • douren7179 2013-08-27 11:00
    关注

    May be you have removed if ($orbit_slider){, but you have left the closing curly brace <?php } ?>

    Remove that line just after the header closing tag.

    </header>
    
    
          remove this ---->  <?php } ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。