How to add php to theme to show alt attributes

Try adding these codes to your theme’s function.php file: function isa_add_img_title( $attr, $attachment = null ) { $img_title = trim( strip_tags( $attachment->post_title ) ); $attr[‘title’] = $img_title; $attr[‘alt’] = $img_title; return $attr; } add_filter( ‘wp_get_attachment_image_attributes’,’isa_add_img_title’, 10, 2 );

File upload size limit in wordpress and php.ini limit

I checked and it seems that your host infinityfree.net block custom php settings. infinityfree.com doesn’t exist. https://forums.cpanel.net/threads/how-can-i-protect-php-ini-with-suphp.127537/#post-554049 https://bobcares.com/blog/disable-custom-user-ini-easyapache-4/

wp_get_attachment_image_attributes not working

I’ve replaced your string_replace call with preg_replace and converted your search string to proper regex (I use regex101 for that). Because you’re trying to replace images in the content, which wordpress saves as a string, you need to find anywhere in the content with an image and replace the src and srcset for it. This … Read more

Non-existent child page URLs redirects to the image attachment URL instead of throwing 404

If I understood you correctly you want to disable all attachment pages and redirect them to 404 page. Place this code in functions.php and try it again. add_action( ‘template_redirect’, ‘redirect_media_to_404’ ); function redirect_media_to_404() { if ( is_attachment() ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); get_template_part( 404 ); exit(); } }

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