WordPress.org

Ready to get started?Download WordPress

Forums

Slideshow
[resolved] shortcode (4 posts)

  1. kendallewis
    Member
    Posted 1 year ago #

    what is the short code to post the slideshow on any WP page?

    http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/

  2. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    You can add [shortcode_deploy id=slideshowID] in your editor to show the slideshow on a page. But you need to do this for every page, of course.

    You could also add a line of php code to your theme, this way you can show slideshows outside of the post and page areas. <?php do_action('slideshow_deploy', 'slideshowID'); ?>

    You can find the slideshow ID and code you should use, in the information section when editing or creating a slideshow.

    Also, there's a widget available to show slideshows in the sidebar.

    Goodluck!

  3. Runee
    Member
    Posted 1 year ago #

    i think i have a similar problem..

    i am very new ad this, and could use some help in were exactly i am supposed to copy paste the short code ad, if i want a slideshow instead of the header image in my theme..
    actually what i want is just like in the first screenshot..

    http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/screenshots/

    i think i understand that it is in the editor.. but where exactly?
    i am afraid of messing things up by chancing things in there, when not really know what i am doing...

    hope that you can help me, and i am not just in over my head..

  4. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Runee,

    The header is part of the WordPress theme, this means that it is not anywhere in the posts or pages. Since the shortcode can only be placed in posts or pages, you should use the PHP line to call the slideshow.

    Below I'll describe how to get the slideshow in the header, but be careful as this is more advanced than editing posts.

    To adapt the header you should go Appearance -> Editor. In the list to your right-hand side choose the Header (header.php) file and in the editor look for <header id="branding" role="banner"> tag.

    Within this tag you'll find the following lines of code, which make for the header images that are default in the Twenty Eleven theme. Delete these lines:

    <?php
    				// Check to see if the header image has been removed
    				$header_image = get_header_image();
    				if ( $header_image ) :
    					// Compatibility with versions of WordPress prior to 3.4.
    					if ( function_exists( 'get_custom_header' ) ) {
    						// We need to figure out what the minimum width should be for our featured image.
    						// This result would be the suggested width if the theme were to implement flexible widths.
    						$header_image_width = get_theme_support( 'custom-header', 'width' );
    					} else {
    						$header_image_width = HEADER_IMAGE_WIDTH;
    					}
    					?>
    			<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
    				<?php
    					// The header image
    					// Check if this is a post or page, if it has a thumbnail, and if it's a big one
    					if ( is_singular() && has_post_thumbnail( $post->ID ) &&
    							( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) &&
    							$image[1] >= $header_image_width ) :
    						// Houston, we have a new header image!
    						echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    					else :
    						// Compatibility with versions of WordPress prior to 3.4.
    						if ( function_exists( 'get_custom_header' ) ) {
    							$header_image_width  = get_custom_header()->width;
    							$header_image_height = get_custom_header()->height;
    						} else {
    							$header_image_width  = HEADER_IMAGE_WIDTH;
    							$header_image_height = HEADER_IMAGE_HEIGHT;
    						}
    						?>
    					<img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />
    				<?php endif; // end check for featured image or standard header ?>
    			</a>
    			<?php endif; // end check for removed header image ?>

    After deleting the aforementioned lines, on the same place add this code:

    <?php do_action('slideshow_deploy', 'your-slideshow-id'); ?>

    I hope you're able to figure this out!

    Best regards,
    Stefan

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags