• arobhy

    (@arobhy)


    I am trying to embed a Slideshare presentation onto my WordPress.org blog and used the embed code that Slideshare gave me. The code just appears as a paragraph and the presentation does not appear. Has anyone experienced this and have a solution to try?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Drew Hammond

    (@drewhammond)

    I believe you need the Jetpack plugin installed.

    The next problem you’ll run into is that the embedded presentations using the shortcode use the old non-HTML5 Flash markup (and therefore don’t work on Apple devices).

    I’ve been looking for a solution for that last problem. I’m about to just write a plugin myself.

    Thread Starter arobhy

    (@arobhy)

    Thanks for that tip. I actually did install Jetpack and saw the embed plug-ins, but was just seeing a blank space in the preview. It might be the issue you’re referring to with non-HTML 5 then. Let me know when you do have a plug-in, thanks!

    Drew Hammond

    (@drewhammond)

    Hm interesting. Do you see any new HTML element being added to the source where your presentation should be?

    Here’s the function I just wrote to solve the flash problem. You can drop this in your functions.php file (note: I’m assuming you have at least some knowledge of PHP here, well at least enough to know where you need to open and/or close PHP tags. You should have access to FTP or something if anything breaks):

    // Unregister existing slideshare shortcode if it exists
    if ( shortcode_exists( 'slideshare' ) ) {
    	// Remove existing Jetpack version
    	remove_shortcode( 'slideshare' );
    }
    
    /**
     * Custom Slideshare Shortcode for non-Flash embeds
     *
     * @param array $atts Shortcode attributes. Only required attribute is "id"
     *
     * @return bool|string
     */
    function custom_slideshare_shortcode( $atts ) {
    
    	if ( ! array_key_exists( 'id', $atts ) ) {
    		// Shortcode didn't contain the id attribute
    		return false;
    	}
    
    	// Retrieve only the numeric ID of the presentation
    	$id = explode( '&', $atts['id'] );
    	$id = $id[0];
    
    	// @todo: is this safe?
    	$presentationUrl = '//www.slideshare.net/slideshow/embed_code/' . $id;
    
    	$output = '<iframe class="slideshare-embed" src="' . $presentationUrl . '" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen="allowfullscreen"> </iframe>';
    
    	return $output;
    }
    
    // Replace with our new version
    add_shortcode( 'slideshare', 'custom_slideshare_shortcode' );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Embed a Slideshare presentation to WordPress.org blog’ is closed to new replies.