Upload image and assign it’s id to post

WordPress attachments are saved in the wp_posts table with the post_type field set to ‘attachment’. The post id for the post that the attachment is ‘linked’ to is in the post_parent field. Keep in mind that an attachment being ‘linked to a post is not really a solid connection. It is very possible to have … Read more

How To Download WordPress Audio Attachments

Some people like to stream audio in the browser, others like to download. Each of them is able set up the browser to choose between downloading or streaming different MIME types to get what they need. On the other hand you can force download of certain MIME type files using PHP header() function. See How … Read more

Problem adding MP3 attachments to a jPlayer playlist

Have a look at wp_localize_script for passing php data to javascript. A pseudo-code example: $tracks = array(); foreach( $mp3_attachments as $mp3_attachment ): $tracks[] = array( ‘mp3’ => $mp3_attachment[‘filename’], ‘title’ => $mp3_attachment[‘title’] ); endforeach; $wpa_track_data = array( ‘tracks’ => $tracks ); wp_enqueue_script( ‘wpa_script’, get_template_directory_uri() . ‘/js/yourscript.js’ ); wp_localize_script( ‘wpa_script’, ‘wpa_data’, $wpa_track_data ); Then in your js … Read more

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