Support » Themes and Templates » Custom theme settings not appearing

  • I have looked at many tutorials for making a WordPress theme and each one I try results in the same problem.

    The options appear in the admin area but are never applied to the website. When I reload the page in the admin area the settings are remembered.

    As a simple start to WordPress I thought making a custom background would be a good idea. Can anyone help?

    As various tutorials suggest I’ve added code like the below to a functions.php file

    add_theme_support( 'custom-background', array(
    		'default-image' => get_template_directory_uri() . '/images/bg.jpg',
    	) );

    Since adding this the options for the background are appearing on my admin panel. How do I get these settings to apply to the website itself?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You need to output them to your theme. For example, in Twenty Twelve theme it is like this:

    <?php $header_image = get_header_image();
    if ( ! empty( $header_image ) ) : ?>
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
    <?php endif; ?>

    Sorry if I was not clear its for the body background image/colour I am trying to do this.

    I assume that my first bit of code correct then?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom theme settings not appearing’ is closed to new replies.