doushuo1989 2015-03-11 10:39
浏览 26

将一些元素称为WP主题

I added some functions into my wp theme but i don't know how to makes them work! :)

this is my functions.php codes:

<?php
if ( ! function_exists('theme_features') ) {

// Register Theme Features
function theme_features()  {

    // Add theme support for Automatic Feed Links
    add_theme_support( 'automatic-feed-links' );

    // Add theme support for Post Formats
    add_theme_support( 'post-formats', array( 'status', 'quote', 'gallery', 'image', 'video', 'audio', 'link', 'aside', 'chat' ) );

    // Add theme support for Featured Images
    add_theme_support( 'post-thumbnails' );

     // Set custom thumbnail dimensions
    set_post_thumbnail_size( 250, 300, true );

    // Add theme support for Custom Background
    $background_args = array(
        'default-color'          => 'ffffff',
        'default-image'          => '',
        'default-repeat'         => '',
        'default-position-x'     => '',
        'wp-head-callback'       => '',
        'admin-head-callback'    => '',
        'admin-preview-callback' => '',
    );
    add_theme_support( 'custom-background', $background_args );

    // Add theme support for Custom Header
    $header_args = array(
        'default-image'          => '',
        'width'                  => 0,
        'height'                 => 0,
        'flex-width'             => false,
        'flex-height'            => false,
        'uploads'                => true,
        'random-default'         => false,
        'header-text'            => false,
        'default-text-color'     => '',
        'wp-head-callback'       => '',
        'admin-head-callback'    => '',
        'admin-preview-callback' => '',
    );
    add_theme_support( 'custom-header', $header_args );

    // Add theme support for HTML5 Semantic Markup
    add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) );

    // Add theme support for document Title tag
    add_theme_support( 'title-tag' );

    // Add theme support for Translation
    load_theme_textdomain( '2015_movie_tr', get_template_directory() . '/language' );
}

// Hook into the 'after_setup_theme' action
add_action( 'after_setup_theme', 'theme_features' );

}
?>

and the items i need to get works are these:

  1. Add background colors
  2. Add header image (right now i have header image but i made it with css background).
  3. Background image

What codes i should add into my theme to these elements get works and in what parts?

since i added these codes into my functions.php i got this error:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '' not found or invalid function name in C:\Program Files (x86)\Ampps\www\tester\wp-includes\plugin.php on line 496

Thank you.

  • 写回答

0条回答 默认 最新

    报告相同问题?