get_the_post_thumbnail() doesn’t taking style attribute

get_the_post_thumbnail attribute array doesn’t know STYLE , the fields that are available for you to use are: src class alt title so just use the class and define you class to it: $attr = array( ‘title’ => get_the_title(), ‘alt’ => get_the_title(), ‘class’ => ‘rss_thumb’ ); $thumb = get_the_post_thumbnail($post->ID, ‘large-thumb’, $attr); and then define the style … Read more

How to find attachment by it’s name?

You have to write custom code to get the attachment id and post_parent by name/ slug or filename(if it has not been changed during the uploading of files). Put the below code in your theme’s functions.php file if( ! ( function_exists( ‘wp_get_attachment_by_post_name’ ) ) ) { function wp_get_attachment_by_post_name( $post_name ) { $args = array( ‘posts_per_page’ … Read more

Trying to hide buttons from Attachment window

Jose, give this a shot and see if that’s the kind of thing you had in mind.. EDIT: Done a little bit of testing and copying of core code to archieve this, but i think the new example i’ve added below should do what you’ve described, remove the buttons, “Insert into Post”, etc…, but keep … Read more

Are captions stored anywhere?

Yes, it stores the caption in it’s own place in the DB. I can’t quote the exact location but in WordPress, “Attachments” are a post type and it stores each attachment just like a post. For an attachment post type, it treats the Image Caption as the_excerpt the Image Description as the_content and the Image … Read more

Is it possible to Schedule Attachments in WordPress?

My idea is that you can setup a post date for the attachments. This can be done using attachment_fields_to_edit to show the UI (is possible use the touch_time internal function). After that, you can filter all the attachments query to show only the attachments with a past or current date. So add_action(‘load-post.php’, ‘setup_attachment_fields’); function setup_attachment_fields() … Read more

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