SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    732
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    using this code to add a custom header to function.php

    Code:
    add_theme_support( 'custom-header', $args );
    $args = array(
    	'width'         => 980,
    	'height'        => 130,
    	'default-image' => get_template_directory_uri() . '/imgs/header.jpg',
    	'uploads'       => true,
    );
    not working. What am doing wrong please?
    thx
    D

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,606
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    First, you have to put the args array before you call the add_theme_support() function. This is because you have to define the args variable before you can use it, otherwise it is just an undeclared variable with a null value.

    Second, you also have the various custom header functions in your theme's header.php file. Those are what respond to the custom header args.

    http://codex.wordpress.org/Custom_Headers
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •