twentyeleven_auto_excerpt_more

Definition:
function twentyeleven_auto_excerpt_more( $more ) {}

Replaces "[…]" (appended to automatically generated excerpts) with an ellipsis and twentyeleven_continue_reading_link().
To override this in a child theme, remove the filter and add your own function tied to the excerpt_more filter hook.

Parameters

  • $more

Source code

function twentyeleven_auto_excerpt_more( $more ) {

	return ' …' . twentyeleven_continue_reading_link();

}

14713

twentyeleven_admin_header_style

Definition:
function twentyeleven_admin_header_style() {}

Styles the header image displayed on the Appearance > Header admin panel.
Referenced via add_custom_image_header() in twentyeleven_setup().

Source code

function twentyeleven_admin_header_style() {

?>

	<style type="text/css">

	.appearance_page_custom-header #headimg {

		border: none;

	}

	#headimg h1,

	#desc {

		font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;

	}

	#headimg h1 {

		margin: 0;

	}

	#headimg h1 a {

		font-size: 32px;

		line-height: 36px;

		text-decoration: none;

	}

	#desc {

		font-size: 14px;

		line-height: 23px;

		padding: 0 0 3em;

	}

	<?php

		// If the user has set a custom color for the text use that

		if ( get_header_textcolor() != HEADER_TEXTCOLOR ) :

	?>

		#site-title a,

		#site-description {

			color: #<?php echo get_header_textcolor(); ?>;

		}

	<?php endif; ?>

	#headimg img {

		max-width: 1000px;

		height: auto;

		width: 100%;

	}

	</style>

<?php

}

14711

twentyeleven_admin_header_image

Definition:
function twentyeleven_admin_header_image() { ?>

Custom header image markup displayed on the Appearance > Header admin panel.
Referenced via add_custom_image_header() in twentyeleven_setup().

Source code

function twentyeleven_admin_header_image() { ?>

	<div id="headimg">

		<?php

		if ( 'blank' == get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) || '' == get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) )

			$style = ' style="display:none;"';

		else

			$style = ' style="color:#' . get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) . ';"';

		?>

		<h1><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>

		<div id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>

		<?php $header_image = get_header_image();

		if ( ! empty( $header_image ) ) : ?>

			<img src="<?php echo esc_url( $header_image ); ?>" alt="" />

		<?php endif; ?>

	</div>

<?php }

14709

twentyeleven_admin_enqueue_scripts

Definition:
function twentyeleven_admin_enqueue_scripts( $hook_suffix ) {}

Properly enqueue styles and scripts for our theme options page.
This function is attached to the admin_enqueue_scripts action hook.

Parameters

  • $hook_suffix

Source code

function twentyeleven_admin_enqueue_scripts( $hook_suffix ) {

	wp_enqueue_style( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.css', false, '2011-04-28' );

	wp_enqueue_script( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.js', array( 'farbtastic' ), '2011-06-10' );

	wp_enqueue_style( 'farbtastic' );

}

14707

theme_options_render_page

Definition:
function theme_options_render_page() {}

Returns the options array for Twenty Eleven.

Source code

function theme_options_render_page() {

	?>

	<div class="wrap">

		<?php screen_icon(); ?>

		<h2><?php printf( __( '%s Theme Options', 'twentyeleven' ), get_current_theme() ); ?></h2>

		<?php settings_errors(); ?>



		<form method="post" action="options.php">

			<?php

				settings_fields( 'twentyeleven_options' );

				$options = twentyeleven_get_theme_options();

				$default_options = twentyeleven_get_default_theme_options();

			?>



			<table class="form-table">



				<tr valign="top" class="image-radio-option color-scheme"><th scope="row"><?php _e( 'Color Scheme', 'twentyeleven' ); ?></th>

					<td>

						<fieldset><legend class="screen-reader-text"><span><?php _e( 'Color Scheme', 'twentyeleven' ); ?></span></legend>

						<?php

							foreach ( twentyeleven_color_schemes() as $scheme ) {

								?>

								<div class="layout">

								<label class="description">

									<input type="radio" name="twentyeleven_theme_options[color_scheme]" value="<?php echo esc_attr( $scheme['value'] ); ?>" <?php checked( $options['color_scheme'], $scheme['value'] ); ?> />

									<input type="hidden" id="default-color-<?php echo esc_attr( $scheme['value'] ); ?>" value="<?php echo esc_attr( $scheme['default_link_color'] ); ?>" />

									<span>

										<img src="<?php echo esc_url( $scheme['thumbnail'] ); ?>" width="136" height="122" alt="" />

										<?php echo $scheme['label']; ?>

									</span>

								</label>

								</div>

								<?php

							}

						?>

						</fieldset>

					</td>

				</tr>



				<tr valign="top"><th scope="row"><?php _e( 'Link Color', 'twentyeleven' ); ?></th>

					<td>

						<fieldset><legend class="screen-reader-text"><span><?php _e( 'Link Color', 'twentyeleven' ); ?></span></legend>

							<input type="text" name="twentyeleven_theme_options[link_color]" id="link-color" value="<?php echo esc_attr( $options['link_color'] ); ?>" />

							<a href="#" class="pickcolor hide-if-no-js" id="link-color-example"></a>

							<input type="button" class="pickcolor button hide-if-no-js" value="<?php esc_attr_e( 'Select a Color', 'twentyeleven' ); ?>" />

							<div id="colorPickerDiv" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>

							<br />

							<span><?php printf( __( 'Default color: %s', 'twentyeleven' ), '<span id="default-color">' . twentyeleven_get_default_link_color( $options['color_scheme'] ) . '</span>' ); ?></span>

						</fieldset>

					</td>

				</tr>



				<tr valign="top" class="image-radio-option theme-layout"><th scope="row"><?php _e( 'Default Layout', 'twentyeleven' ); ?></th>

					<td>

						<fieldset><legend class="screen-reader-text"><span><?php _e( 'Color Scheme', 'twentyeleven' ); ?></span></legend>

						<?php

							foreach ( twentyeleven_layouts() as $layout ) {

								?>

								<div class="layout">

								<label class="description">

									<input type="radio" name="twentyeleven_theme_options[theme_layout]" value="<?php echo esc_attr( $layout['value'] ); ?>" <?php checked( $options['theme_layout'], $layout['value'] ); ?> />

									<span>

										<img src="<?php echo esc_url( $layout['thumbnail'] ); ?>" width="136" height="122" alt="" />

										<?php echo $layout['label']; ?>

									</span>

								</label>

								</div>

								<?php

							}

						?>

						</fieldset>

					</td>

				</tr>

			</table>



			<?php submit_button(); ?>

		</form>

	</div>

	<?php

}

14630