将unctions.php复制到子主题后获得白色空白页面

时间:2014-10-29 作者:User01

在复制函数后,我得到了白色空白页。php到我的孩子主题。

如何更改“like\\u escape”?我能找到什么文件?

我看到这个通知:

Notice: like_escape is deprecated since version 4.0! Use wpdb::esc_like() instead. in /home7/homecre1/public_html/betasite/wp-includes/functions.php on line 3201
这里会显示通知

http://goo.gl/zgWVMQ

我的搜索引擎没有使用任何插件

下面是函数。php

<?php
/**
* AccessPress Ray functions and definitions
*
* @package AccessPress Ray
*/

if ( ! function_exists( \'accesspress_ray_setup\' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function accesspress_ray_setup() {
/**
 * Set the content width based on the theme\'s design and stylesheet.
 */
global $content_width;
/**
 * Global content width.
 */
 if (!isset($content_width))
    $content_width = 750; /* pixels */

/*
 * Make theme available for translation.
 * Translations can be filed in the /languages/ directory.
 * If you\'re building a theme based on AccessPress Ray, use a find and replace
 * to change \'accesspress_ray\' to the name of your theme in all the template files
 */
load_theme_textdomain( \'accesspress_ray\', get_template_directory() . \'/languages\' );

/**
 * Add callback for custom TinyMCE editor stylesheets. (editor-style.css)
 * @see http://codex.wordpress.org/Function_Reference/add_editor_style
 */
add_editor_style(); 

 // Add default posts and comments RSS feed links to head.
 add_theme_support( \'automatic-feed-links\' );
 add_theme_support( \'html5\', array( \'gallery\', \'caption\' ) );
 /*
 * Enable support for Post Thumbnails on posts and pages.
 *
 * @link   http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
 */
 add_theme_support( \'post-thumbnails\' );

 add_image_size( \'event-thumbnail\', 135, 100, true); //Latest News Events Small Image
 add_image_size( \'featured-thumbnail\', 350, 245, true); //Featured Image
 add_image_size( \'portfolio-thumbnail\', 400, 450, true); //Portfolio Image      

 // This theme uses wp_nav_menu() in one location.
 register_nav_menus( array(
    \'primary\' => __( \'Primary Menu\', \'accesspress_ray\' ),
    \'secondary\' => __( \'Secondary Menu\', \'accesspress_ray\' ),
 ) );

 // Setup the WordPress core custom background feature.
 add_theme_support( \'custom-background\', apply_filters(  \'accesspress_ray_custom_background_args\', array(
    \'default-color\' => \'ffffff\',
    \'default-image\' => \'\',
) ) );

add_filter(\'widget_text\', \'do_shortcode\');
 }
 endif; // accesspress_ray_setup
 add_action( \'after_setup_theme\', \'accesspress_ray_setup\' );

/**
* Implement the Theme Option feature.
*/
require get_template_directory() . \'/inc/accesspressray-custom-header.php\';

/**
* Implement the Theme Option feature.
*/
require get_template_directory() . \'/inc/admin-panel/accesspressray-theme-options.php\';

/**
* Custom template tags for this theme.
*/
require get_template_directory() . \'/inc/accesspressray-template-tags.php\';

/**
* Custom functions that act independently of the theme templates.
*/
 require get_template_directory() . \'/inc/accesspressray-custom-functions.php\';

/**
* Implement the custom metabox feature
*/
require get_template_directory() . \'/inc/accesspressray-custom-metabox.php\';

/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . \'/inc/jetpack.php\';

2 个回复
SO网友:iyrin

您不应该有重复的函数副本。php文件。将其复制到子主题后,原始函数。php(父主题中的一个)应该留空,这样函数就不会重复。这可能就是为什么该通知在您的网站上出现两次,但该通知可能与此问题无关。

SO网友:Matt Cromwell

您根本不需要将父主题函数复制到子主题中。WordPress将加载函数。来自父主题的php。之后将加载子主题函数。只需保持父主题不变,并保持子主题功能。php文件为空,一切正常。然后,您可以在子主题中添加其他自定义项,它们也将加载。

有关更多详细信息,请参见此处(在页面中搜索“子主题”):https://developer.wordpress.org/themes/basics/theme-functions/

结束

相关推荐

theme functions (hooks)

WordPress已经提出了这个问题,但没有答案。我只是想在这个论坛上试试,如果有人知道的话,因为我也有同样的问题。要使用jquery滑块编辑我的主题,如何转到该脚本?,显示“$主题->挂钩(\'content\\u before\');”在content div标记中。有人能帮忙吗?我的主题索引。php包含以下内容<div id=\"main\"> <?php $theme->hook(\'main_before\'); ?> &#x