• Resolved R-P

    (@r-p)


    Hi,

    I want to add a slideshow in the header of the Twenty Ten theme. In stead of the standard header image. I don’t know how to do that. Can you help me?

Viewing 15 replies - 1 through 15 (of 26 total)
  • Plugin Author Josh Leuze

    (@jleuze)

    Hi, check out this video, it will show you how to do that.

    Thread Starter R-P

    (@r-p)

    thank you!

    Plugin Author Josh Leuze

    (@jleuze)

    No problem!

    Thread Starter R-P

    (@r-p)

    Hi,

    I now use 2010 Weaver. Is it still possible to replace the standard header image with a slideshow? If yes, how do I do that?

    Plugin Author Josh Leuze

    (@jleuze)

    Yes you can do that. It is much easier than with with Twenty Ten actually, check out this post for more info.

    @jleuze
    I checked out your plugin which is great!
    Wondering if there is a way to have the banner slideshow on the homepage ( latest posts ) and keep the stock header image functionality for post pages ( single )
    Thanks,

    Plugin Author Josh Leuze

    (@jleuze)

    Hi Don, try taking this bit of code from the header:

    <?php
    					// Check if this is a post or page, if it has a thumbnail, and if it's a big one
    					if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
    							has_post_thumbnail( $post->ID ) &&
    							( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    							$image[1] >= HEADER_IMAGE_WIDTH ) :
    						// Houston, we have a new header image!
    						echo get_the_post_thumbnail( $post->ID );
    					elseif ( get_header_image() ) : ?>
    						<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
    					<?php endif; ?>

    And replacing it with this:

    <?php if ( is_front_page() ):
    
    					if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow();
    
    				else:
    
    					// Check if this is a post or page, if it has a thumbnail, and if it's a big one
    					if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
    							has_post_thumbnail( $post->ID ) &&
    							( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    							$image[1] >= HEADER_IMAGE_WIDTH ) :
    						// Houston, we have a new header image!
    						echo get_the_post_thumbnail( $post->ID );
    					elseif ( get_header_image() ) : ?>
    						<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
    					<?php endif;
    
    				endif; ?>

    this is very timely, as this is exactly what I’m doing – but when I post that into my twentyten header, I get errors. Dreamweaver says there’s an error on line five where it just has “else:” – which also leads to an error on teh last “Endif” and also further down in the code at the end of the #access div.

    And, sadly, I’m just not PHP-savvy enough to see how to fix it. Any thoughts?

    Plugin Author Josh Leuze

    (@jleuze)

    Thanks for catching that, there was a typo in there, this should work correctly:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    oops – you’ve been moderated!

    caught the code from my email and it works like a charm – thanks so much.

    Plugin Author Josh Leuze

    (@jleuze)

    Whatever, here’s the correction with ten lines of code…

    <?php if ( is_front_page() ): if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); else:
    // Check if this is a post or page, if it has a thumbnail, and if it's a big one
    					if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
    							has_post_thumbnail( $post->ID ) &&
    							( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    							$image[1] >= HEADER_IMAGE_WIDTH ) :
    						// Houston, we have a new header image!
    						echo get_the_post_thumbnail( $post->ID );
    					elseif ( get_header_image() ) : ?>
    						<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /> <?php endif; endif; ?>

    Thanks heaps for this – I’ll be giving it a go as soon as I can.
    Cheers,

    Plugin Author Josh Leuze

    (@jleuze)

    No problem Don!

    Plugin Author Josh Leuze

    (@jleuze)

    There was another little typo in there, try this:

    <?php if ( is_front_page() ) { if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); } } else {
    // Check if this is a post or page, if it has a thumbnail, and if it's a big one
    if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
    	has_post_thumbnail( $post->ID ) && ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    	$image[1] >= HEADER_IMAGE_WIDTH ) :
    	// Houston, we have a new header image!
    	echo get_the_post_thumbnail( $post->ID );
    elseif ( get_header_image() ) : ?>
    	<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
    <?php endif; } ?>
Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘[Plugin: Meteor Slides] Add slideshow in header Twenty Ten’ is closed to new replies.