Media Library it doesn’t show any of the uploaded images after updating wordpress 6.6.2

After a thorough inspection of the database, i saw that the post_type for the images had changed to “post” instead of “attachment“. The solution Update Post mime type from “post_status = inherit” sql: // Mime type – img/jpeg UPDATE wp_posts SET post_type = ‘attachment’ WHERE wp_posts.post_status = ‘inherit’ and wp_posts.post_mime_type = ‘image/jpeg’; // Mime type – img/png UPDATE wp_posts SET post_type = ‘attachment’ WHERE wp_posts.post_status = ‘inherit’ and wp_posts.post_mime_type = ‘image/png’; // Mime type – img/webp UPDATE wp_posts SET post_type = ‘attachment’ WHERE wp_posts.post_status = ‘inherit’ and wp_posts.post_mime_type = ‘image/webp’; // Mime type – … Read more

Featured Image add tab

WordPress does not have a built-in hook or function on the PHP side that allows you to directly add a new tab to the Media Library Modal window. To achieve this, you need to use JavaScript to modify the media uploader interface. You can add a custom tab to the WordPress Media Library modal by … Read more

medium_large image size not displaying properly on the frontend?

I saw this problem recently on a project, and the answer is to disable responsive image markup. Simply add the below code into your theme’s functions.php and you are golden: add_filter( ‘wp_calculate_image_srcset’, ‘__return_false’ ); Ref: How do I disable responsive images in WP 4.4? Afterwards, you can insert the Medium Large a.k.a. medium_large images (if … Read more

Get featured image thumbnail and inserting into custom field on wordpress posts

You will want to make the following changes to your add_custom_field_automatically function. First, we will need to add the global $post; as we will need the $post variable inside the function scope. You do this with a comma. more on variable scope here. add_action(‘publish_post’, ‘add_custom_field_automatically’); function add_custom_field_automatically($post_ID) { global $wpdb, $post; if(!wp_is_post_revision($post_ID)) { add_post_meta($post_ID, ‘field-name’, … Read more

Button over featured image on hover

Using CSS, you can try just moving the ‘hover’ state a bit higher up the chain. .brbl-blog-item:hover .brbl-overlay{ /*Theme has this set to `transparent` so change to 70% white*/ background: RGBA(255,255,255,0.7); z-index: 1; } .brbl-blog-item:hover .brbl-post-btn{ opacity: 1; z-index: 10; } This does mean that the entire item including the content is subject to the … Read more

How do I add text or message above the featured image area in gutenberg for a CPT

Try this: function wrapPostFeaturedImage( OriginalComponent ) { const currentPostType = wp.data.select( ‘core/editor’ ).getCurrentPostType(); // Do nothing, if the post type is not rt_brands. if ( ‘rt_brands’ !== currentPostType ) { return OriginalComponent; } return function( props ) { // Your code here. }; } You can also: Conditionally add your filter: // Check if the … Read more

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