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 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了
  • ¥100 H5网页如何调用微信扫一扫功能?
  • ¥15 讲解电路图,付费求解