Audio file’s length (duration) is missing from Attachment Details in Media Library [closed]

I found that this issue could be overcome by opening the mp3 file in the excellent Linux/Windows application Mp3 Diags and applying the Rebuild VBR Data transformation. It discards the file’s Xing header and attaches a new one. After doing this, the files’s duration and bitrate are listed in it’s Attachment Details when it is … Read more

Disable featured image

It is definitely possible. We may need more info though. Do you know how to use page templates? Copy your single.php (or your page.php) from your theme and name it single-your-cpt-slug.php. (Replace ‘your-cpt-slug’ with your actual cpt slug). Within this file remove the call to the featured image. This is a pretty generic answer without … Read more

How to specify width and height in the_content for image attachments

I believe this is what your looking for. The complete code can be found in twentyten’s loop-attachment.php template. Look for the <p class=”attachment”> tag. There are two filters there. One for width and the other for height (currently set to 900px for both). <?php if ( wp_attachment_is_image() ) : $attachments = array_values( get_children( array( ‘post_parent’ … Read more

custom admin thumbnail for videos, not getting post’s id?

First, you don’t need the apply_filters below. That is called directly from the wp_mime_type_icon() function already. The issue is that your add_filter() call is missing the $accepted_args parameter. The add_filter() function has the following construct: add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) So the $accepted_args is 1 by default. Because of this, only the … Read more

How do i add LIGHTBOX to Attachments?

i think most lightbox plugins require the rel or class attribute to be on the link, so: <a href=”https://wordpress.stackexchange.com/questions/43630/<?php echo wp_get_attachment_url($post->ID); ?>” rel=”lightbox” title=”<?php echo wp_specialchars( get_the_title($post->ID), 1 ) ?>”><?php echo wp_get_attachment_image($post->ID, ‘large’ ); ?></a>

How do I permanently Disable Attachment Post URL

The form for the ‘From Url’ tab seems to be pretty much hard-coded, so I don’t think there is away of removing the ‘Link Image To’ field. However, for the Media Library tab you can remove the link field, with the following: add_filter(‘attachment_fields_to_edit’, ‘my_attachment_fields_edit’, 10, 2); function my_attachment_fields_edit($form_fields,$post){ //Set attachment link to none and hide … Read more

How to fetch only media that was already attached to a post/page?

A similar approach to your post_parent idea is to add a filter to posts_where: function bbg_filter_out_non_attachments( $sql ) { global $wpdb; // Maybe do some conditional logic to decide whether to filter this query, then… return $sql . ” AND $wpdb->posts.post_parent != 0 “; } add_filter( ‘posts_where’, ‘bbg_filter_out_non_attachments’ ); Another technique is to do a … Read more

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