Many slow queries post_type = ‘attachment’;

This is bug #31071: media / post_mime_type related queries are very slow on larger sites. It should have been fixed for version 4.8 now. You can try it on a test site that is a mirror of your production site. There are some very interesting ideas in that bug discussion. See if you can use … Read more

How do you create an attachment ID with Ajax submit? No page refresh

Here’s my solution for creating an attachment ID with a temporary title and the post_parent which it is attached to. My jQuery psuedo code, without the needless stuff: jQuery(‘.addImage’).live(‘click’, function() { jQuery.ajax({ type: ‘post’, url: ajaxurl, data: { action: ‘save_attachment’, _ajax_nonce: jQuery(‘#nonce_add’).val(), post_parent: jQuery(‘#post_ID’).val(), attach_title: ‘Attachment ‘ + size }, success: function( res ) { … Read more

Show Multiple Size URL of one Featured Image/Thumbnail?

no problem to have 2 or more post thumbnails of different sizes. but what is the “ref” attribute ? do you mean “rel” ? anyhow – example from the :codex <?php if ( has_post_thumbnail()) { $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), ‘large’); echo ‘<a href=”‘ . $large_image_url[0] . ‘” title=”‘ . the_title_attribute(‘echo=0’) . ‘” >’; the_post_thumbnail(‘thumbnail’); echo … Read more

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