2014-11-24 19 views
0

我禁用了所有插件,所有空白和php評論在function.phpfunctions.php導致白屏和媒體庫問題

但問題沒有解決。

當我在function.php刪除所有代碼的問題解決,但如果在文件中寫<?php ?>問題回報

functions.php事業的白色屏幕和媒體庫不loaded.Here的function.php

<?php 
remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); 
remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); 
add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10); 
add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10); 
function my_theme_wrapper_start() { echo '<section class="header">'; } 
function my_theme_wrapper_end() { echo '</section>'; } 
add_theme_support('post-thumbnails'); 
set_post_thumbnail_size(70, 150); 
function register_my_menu() { 
    register_nav_menu('header-menu',__('Header Menu')); 
} 
add_action('init', 'register_my_menu'); 
add_filter('add_to_cart_text', 'woo_custom_cart_button_text');       
add_filter('woocommerce_product_add_to_cart_text', 'woo_custom_cart_button_text'); 
function arphabet_widgets() { 
    register_sidebar(array(
     'name' => 'sidebar', 
     'id' => 'right-panel', 
     'before_widget' => '<div class="panel">', 
     'after_widget' => '</div>', 
     'before_title' => '<h2 class="title">', 
     'after_title' => '</h2>', 
    )); 
} 
add_action('widgets_init', 'arphabet_widgets'); 
function search() { 

    register_sidebar(array(
     'name' => 'search', 
     'id' => 'search-panel', 
     'before_widget' => '<div class="panel">', 
     'after_widget' => '</div>', 
     'before_title' => '<h2 class="title">', 
     'after_title' => '</h2>', 
    )); 
} 
add_action('widgets_init', 'search'); 
add_theme_support('woocommerce'); 
?> 

如何解決?

+3

打開調試。它會給你一個問題的具體行號。魔術,我告訴你。 – rnevius 2014-11-24 14:37:32

+0

@rnevius阿門。如何在這裏:http://codex.wordpress.org/Debugging_in_WordPress – nunorbatista 2014-11-24 14:45:49

回答

2

嘗試從文件functions.php中去除PHP結尾標記?>。這是不必要的,我遇到了「?>」之後出現空白/換行符的情況 - 標籤導致WordPress拋出空白屏幕,因爲標題發送得太早/多次(標題已經發送)。