Can’t get default values to work with custom shortcode

extract takes and associative array and explodes it out in variables that reflect the array key names. $atts[‘height’] would just be $height, in other words. The relevant two lines of your code would become: <param name=”type” value=”video/quicktime” height=”‘.$height.'” width=”‘.$width.'”> <embed src=”‘.$url.'” height=”‘.$height.'” width=”‘.$width.'” autoplay=”false” type=”video/quicktime” pluginspage=”http://www.apple.com/quicktime/download/”> If you did still want to use the indexing, … Read more

WordPress: embedding last posted video

This should work, even outside of the loop: $latestPost = get_posts(‘numberposts=1&category=YOUR_CATEGORY_ID’); The WordPress function get_posts sorts by post date, newest-to-oldest by default, so you’d get the newest post in whatever category you choose. Also, even though you are only requesting one post, the response will still be an array: echo $latestPost[0]->post_content; Edit: Since the video … Read more

Embedded Feed Update

I dont no about the plugin, but the default on feed-function of WordPress have a cache, there cache all content for 12 hour and then regenerate the content. You can change this via a small function, like in a plugin or you copy the source to the functions.php of the current active theme; but a … Read more

Displaying cf post formats with oembed

<?php if (strstr($audio, ‘<iframe’)) { echo $audio; } else { echo wp_oembed_get( get_post_meta($post->ID, ‘_format_audio_embed’, true) ); } ?> Of course, this would require that you get the custom field with the audio embed code or url into $audio 🙂 Edit – try: <?php $audio = get_post_meta($post->ID, ‘_format_audio_embed’, true); if (strstr($audio, ‘<iframe’)) { echo $audio; } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)