[FONT=monospace]Mein bLog ist momentan etwas chaotisch, da die ausgewählten feature images einfach nicht auf die breite der spalten angepasst werden. habe sämtliche foren durchgelesen und alles nach anleitung in der functions.php geändert, aber es ändert sich nichts.
Die ersten beiden Beiträge stimmen nur, weil ich da die Bilder in entspr. Größe gespeichert hab. bei den restlichen soll wordpress das selbst anpassen.
[/FONT][FONT=monospace]die functions.php muss ich aufsplitten, weil ich hier sonst die maximale zeichenzahl überschreite:
Teil 1:
[/FONT]
PHP
<?php
/**
* Set the content width based on the theme's design and stylesheet.
*/
if ( ! isset( $content_width ) )
$content_width = 500;
$themecolors = array(
'bg' => 'ffffff',
'text' => '000000',
'link' => '0060ff'
);
/** Tell WordPress to run coraline_setup() when the 'after_setup_theme' hook is run. */
add_action( 'after_setup_theme', 'coraline_setup' );
if ( ! function_exists( 'coraline_setup' ) ):
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* To override coraline_setup() in a child theme, add your own coraline_setup to your child theme's
* functions.php file.
*
* @uses add_theme_support() To add support for post thumbnails and automatic feed links.
* @uses register_nav_menus() To add support for navigation menus.
* @uses add_custom_background() To add support for a custom background.
* @uses add_editor_style() To style the visual editor.
* @uses load_theme_textdomain() For translation/localization support.
* @uses add_custom_image_header() To add support for a custom header.
* @uses register_default_headers() To register the default custom header images provided with the theme.
* @uses set_post_thumbnail_size() To set a custom post thumbnail size.
*
* @since Coraline 1.0
*/
function coraline_setup() {
// This theme has some pretty cool theme options
require_once ( get_template_directory() . '/inc/theme-options.php' );
// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();
// This theme uses post thumbnails
add_theme_support( 'post-thumbnails' );
// Add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );
// Make theme available for translation
// Translations can be filed in the /languages/ directory
load_theme_textdomain( 'coraline', TEMPLATEPATH . '/languages' );
$locale = get_locale();
$locale_file = TEMPLATEPATH . "/languages/$locale.php";
if ( is_readable( $locale_file ) )
require_once( $locale_file );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Navigation', 'coraline' ),
) );
// This theme allows users to set a custom background
add_custom_background();
// Your changeable header business starts here
define( 'HEADER_TEXTCOLOR', '000' );
// No CSS, just an IMG call. The %s is a placeholder for the theme template directory URI.
define( 'HEADER_IMAGE', '%s/images/headers/water-drops.jpg' );
// The height and width of your custom header. You can hook into the theme's own filters to change these values.
// Add a filter to coraline_header_image_width and coraline_header_image_height to change these values.
define( 'HEADER_IMAGE_WIDTH', apply_filters( 'coraline_header_image_width', 990 ) );
define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'coraline_header_image_height', 180 ) );
// We'll be using post thumbnails for custom header images on posts and pages.
// We want them to be 940 pixels wide by 198 pixels tall.
// Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
// Add a way for the custom header to be styled in the admin panel that controls
// custom headers. See coraline_admin_header_style(), below.
add_custom_image_header( 'coraline_header_style', 'coraline_admin_header_style', 'coraline_admin_header_image' );
// ... and thus ends the changeable header business.
// Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
register_default_headers( array(
'water-drops' => array(
'url' => '%s/images/headers/water-drops.jpg',
'thumbnail_url' => '%s/images/headers/water-drops-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Water drops', 'coraline' )
),
'limestone-cave' => array(
'url' => '%s/images/headers/limestone-cave.jpg',
'thumbnail_url' => '%s/images/headers/limestone-cave-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Limestone cave', 'coraline' )
),
'Cactii' => array(
'url' => '%s/images/headers/cactii.jpg',
'thumbnail_url' => '%s/images/headers/cactii-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Cactii', 'coraline' )
)
) );
}
endif;
if ( ! function_exists( 'coraline_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog
*
* @since Coraline 1.0
*/
function coraline_header_style() {
// If no custom options for text are set, let's bail
// get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value
if ( HEADER_TEXTCOLOR == get_header_textcolor() )
return;
// If we get this far, we have custom styles. Let's do this.
?>
<style type="text/css">
<?php
// Has the text been hidden?
if ( 'blank' == get_header_textcolor() ) :
?>
#site-title,
#site-description {
position: absolute;
left: -9000px;
}
<?php
// If the user has set a custom color for the text use that
else :
?>
#site-title a,
#site-description {
color: #<?php echo get_header_textcolor(); ?> !important;
}
<?php endif; ?>
</style>
<?php
}
endif;
if ( ! function_exists( 'coraline_admin_header_style' ) ) :
/**
* Styles the header image displayed on the Appearance > Header admin panel.
*
* Referenced via add_custom_image_header() in coraline_setup().
*
* @since Coraline 1.0
*/
function coraline_admin_header_style() {
?>
<style type="text/css">
.appearance_page_custom-header #headimg {
background: #<?php echo get_background_color(); ?>;
border: none;
text-align: center;
}
#headimg h1,
#desc {
font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
}
#headimg h1 {
margin: 0;
}
#headimg h1 a {
font-size: 36px;
letter-spacing: -0.03em;
line-height: 42px;
text-decoration: none;
}
#desc {
font-size: 18px;
line-height: 31px;
padding: 0 0 9px 0;
}
<?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: 990px;
width: 100%;
}
</style>
<?php
}
endif;
if ( ! function_exists( 'coraline_admin_header_image' ) ) :
/**
* Custom header image markup displayed on the Appearance > Header admin panel.
*
* Referenced via add_custom_image_header() in coraline_setup().
*
* @since Coraline 1.0
*/
function coraline_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 home_url( '/' ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<div id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
<img src="<?php esc_url ( header_image() ); ?>" alt="" />
</div>
<?php }
endif;
/**
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
*
* @since Coraline 1.0
*/
function coraline_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'coraline_page_menu_args' );
/**
* Sets the post excerpt length to 40 characters.
*
* @since Coraline 1.0
* @return int
*/
function coraline_excerpt_length( $length ) {
return 40;
}
add_filter( 'excerpt_length', 'coraline_excerpt_length' );
/**
* Returns a "Continue Reading" link for excerpts
*
* @since Coraline 1.0
* @return string "Continue Reading" link
*/
function coraline_continue_reading_link() {
return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'coraline' ) . '</a>';
}
Alles anzeigen