我遇到了問題,我的網站。Php致命錯誤。如何將一個類包含到index.php中?
PHP Fatal error: Class 'innovation_ruby_util' not found in D:\inetpub\vhosts\example.com\httpdocs\wp-content\themes\innovation\index.php on line 7
請幫我在代碼中添加以下
<?php
/**
* Innovation created by ThemeRuby
* This file display home layout
*/
//get home options
$ruby_options['page_layout'] = innovation_ruby_util::get_theme_option('home_layout');
$ruby_options['sidebar_name'] = innovation_ruby_util::get_theme_option('home_sidebar');
$ruby_options['sidebar_position'] = innovation_ruby_util::get_theme_option('home_sidebar_position');
$ruby_options['big_first'] = innovation_ruby_util::get_theme_option('big_post_first');
if ('default' == $ruby_options['sidebar_position']) {
$ruby_options['sidebar_position'] = innovation_ruby_util::get_theme_option('site_sidebar_position');
}
//render featured area
get_template_part('templates/section', 'featured');
//render home columns
get_template_part('templates/section','columns');
//render layout
innovation_ruby_blog_layout::render($ruby_options);
您需要[**'require_once' **](http://php.net/manual/en/function.require-once.php)。像'require_once(path-to-class-file)';' –
我不知道php,請問你可以告訴我在index.php文件中添加這段代碼的位置 – blacklisthackers
你需要在所有頁面中使用嗎? –