Adding featured image via PHP

Use the set_post_thumbnail function. set_post_thumbnail( $post_ID, $thumbnail_id ); Require you use WordPress 3.1.0 or later. You need call this function after you have successfully created your post via wp_insert_post and have a valid $post_ID.

the_author_meta not working

It’s entirely possible that you are calling the_author_meta() from outside of your post loop in the author.php template in which case the above will not work. Instead, you can use get_the_author_meta(‘facebook’) or… get_the_author_meta(‘facebook’, $user_id) where $user_id is the ID# of the current user/author. To get the user ID you can do this; <div class=”user_social_icons”> <a … Read more

Audio tags around Mp3 URL in content

Filter the_content ond/or the_excerpt and replace audio URLs that are not an attribute value already. Example: add_filter( ‘the_content’, ‘wpse_82336_audio_url_to_shortcode’, 1 ); add_filter( ‘the_excerpt’, ‘wpse_82336_audio_url_to_shortcode’, 1 ); function wpse_82336_audio_url_to_shortcode( $content ) { # See http://en.wikipedia.org/wiki/Audio_file_format # Adjust the list to your needs $suffixes = array ( ‘3gp’, ‘aa3’, ‘aac’, ‘aiff’, ‘ape’, ‘at3’, ‘au’, ‘flac’, ‘m4a’, ‘m4b’, … Read more

How do I enable HTML5 prefetching on this page?

If I understand correctly you are putting that code in header.php, that is required in the file single-dress.php using get_header(), and in the same file, after about 2 dozen lines, you define the variables you used 2 dozen lines before. So, either your server has an embedded time machine, or your code can’t work. What … Read more