许多WordPress框架包括助手函数和预定义的文件夹位置。WP框架编码很好,但需要学习和检查代码才能找到文档。
在文件核心中。php定义了许多常量,但我没有看到图像,但定义了THEME\\u IMAGE,因此IMAMGE可能引用子主题目录中的IMAGES文件夹。
以下是可供您使用的常量列表:
WP Framework V 3.6 core。php:
function wpf_initial_constants() {
// Sets the File path to the current parent theme\'s directory.
define( \'PARENT_THEME_DIR\', TEMPLATEPATH );
// Sets the URI path to the current parent theme\'s directory.
define( \'PARENT_THEME_URI\', get_template_directory_uri() );
// Sets the File path to the current parent theme\'s directory.
define( \'CHILD_THEME_DIR\', STYLESHEETPATH );
// Sets the URI path to the current child theme\'s directory.
define( \'CHILD_THEME_URI\', get_stylesheet_directory_uri() );
// Sets the file path to WP Framework
define( \'WPF_DIR\', PARENT_THEME_DIR . \'/framework\' );
// Sets the URI path to WP Framework
define( \'WPF_URI\', PARENT_THEME_URI . \'/framework\' );
// Sets the file path to extensions
define( \'WPF_EXT_DIR\', WPF_DIR . \'/extensions\' );
// Sets the URI path to extensions
define( \'WPF_EXT_URI\', WPF_URI . \'/extensions\' );
}
/**
* Templating constants that you can override before WP Framework is loaded.
*
* @since 0.3.0
*
* @return void
*/
function wpf_templating_constants() {
// Sets a unique ID for the theme.
if ( !defined( \'THEME_ID\' ) )
define( \'THEME_ID\', \'wpf_\' . get_template() );
// Sets the default theme options db name
if ( !defined( \'THEME_OPTIONS\' ) )
define( \'THEME_OPTIONS\', \'theme_options\' );
// Sets relative paths for the default directories/paths
if ( !defined( \'THEME_LIBRARY\' ) )
define( \'THEME_LIBRARY\', \'/library\' );
if ( !defined( \'THEME_I18N\' ) )
define( \'THEME_I18N\', THEME_LIBRARY . \'/languages\' );
if ( !defined( \'THEME_FUNC\' ) )
define( \'THEME_FUNC\', THEME_LIBRARY . \'/functions\' );
if ( !defined( \'THEME_IMG\' ) )
define( \'THEME_IMG\', THEME_LIBRARY . \'/images\' );
if ( !defined( \'THEME_CSS\' ) )
define( \'THEME_CSS\', THEME_LIBRARY . \'/css\' );
if ( !defined( \'THEME_JS\' ) )
define( \'THEME_JS\', THEME_LIBRARY . \'/js\' );
// Sets the default custom header image
if ( !defined( \'DEFAULT_HEADER_IMAGE\' ) )
define( \'DEFAULT_HEADER_IMAGE\', get_theme_part( THEME_IMG . \'/custom-header.gif\' ) );
}