I learnt this trick a few days ago, its possible to embed  your images, text files into your wordpress blog posts. WordPress short code API is a easiest way to to add external files in your wordpress posts.

First open your theme “functions.php” and put the following code snippet:

function show_file_func( $atts ) {
extract( shortcode_atts( array(
'file' => ''
), $atts ) );

if ($file!='')
return @file_get_contents($file);
add_shortcode( 'show_file', 'show_file_func' );

After that, you can write somthing like that in your post:

[show_file file="http://www.yourdomain.com/file.html"]

Comments are closed.

Post Navigation