WordPress Media Library

Hi unless you’ve backed up your files there’s no other way to retrieve images except for asking your webhost to see if they have a backup. My host does, and keeps it for 30 days before deleting the backup, so that’s what I’d try first. In future, make sure you back up your sites regularly.

Media Custom Fields – get a value with PHP

As taken from : http://wordpress.org/extend/plugins/media-custom-fields/faq/ How does this plugin handle my data? Media items are stored in WordPress just like regular posts. This enables us to use native WordPress functions to store and retrieve your custom fields. Due to this, your data is stored in a very future-proof way, in the postmeta table of the … Read more

Get attachment if matches a variable

$attachments holds array of posts, you are missing something like: $attachment = $attachments[0]; or foreach( $attachments as $attachment ) Update Nope, like this: foreach( $attachments as $attachment ) if ($attachment->post_title == $programme) { echo the_attachment_link($post->ID, false); break; }

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