from your question i under that you want fixed size cropped images when you upload image, why don’t you use wp_get_image_editor
. I used it in my project where i wanted cropped images of fixed size so i did this code.
$path = $newPath['basedir'].'/newImgas/';
$cropfile = uniqid() . '.png';
$cropfilename = $path.$cropfile;
$cropImage = home_url(). '/wp-content/uploads/newImgas/'.$cropfile;
$c_image = wp_get_image_editor($newImage);
if ( ! is_wp_error($c_image) ) {
$c_image->resize( 600, 600, TRUE);
$c_image->save( $cropfilename );
}
You can find example here. Please reply me if it isn’t what you wanted.
Related Posts:
- The the_post_thumbnail without srcset?
- My child theme doesn’t work Error: “The parent theme is missing. Please install your parent theme”
- How to get gallery images?
- Add colors to existing color palette without replacing it
- Child Theme not loading parent CSS
- How do I get gallery thumbnail URL and change the default thumbnail size?
- How do I get a parent theme modification from a child theme?
- CSS in child theme not overriding the parent theme [closed]
- Optimal solution to develop a wordpress theme?
- Should I update my _s theme?
- Create a theme by combining a parent and a child theme
- Cannot get full thumbnail size using the_post_thumbnail
- Override Constants in Child theme
- how can I remove the sidebar from my wp homepage [closed]
- Does any theme support child theme?
- Am I supposed to create a child theme for every theme I use?
- How to remove a file included in parent theme with locate_template() via child theme?
- Cannot figure out how to overwrite files in child theme
- How to add theme support?
- Override template file i subfolders
- Include Parent functions.php in Child Theme functions.php
- Why is it needed to enqueue parent stylesheet in child theme?
- Child Theme’s style.css not loading in mobile browser
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- Renaming a theme so it aids SEO and the theme used is hidden
- Overrite parent functions using child functions
- Getting Different Size Of Attachment Images
- Will my site get messed up when the wordpress theme updates if I edited the html code in the editor to change footer?
- How to correctly enqueue the parent and child theme stylesheets in the creation of a child theme? [duplicate]
- Create a child theme from multiple themes
- Change image size depending on page
- Are seven additional image sizes are too many?
- Starting point for custom Themes [closed]
- Simple child theme modification but links are broken
- Why still output /wp-content/themes/twentynineteen?
- Alignment Problem [closed]
- What $handle does WordPress use for a theme’s implicit style.css?
- Unable to change the priority with ‘remove_action’ and ‘add_action’ in child theme
- LESS not working in WordPress [closed]
- Remove h1 from 2015 theme
- Change Image Sizes for Mobile Theme
- Converting a theme to a child theme in a network
- How to add cropped custom header image?
- Is there a way to serve different resolution images to different devices?
- How to modify theme content in Thematic?
- Why front-page.php doesn’t show content of file instead shows loop
- Copying a modified theme from one wordpress site to another wordpress site [closed]
- How can I access variables from theme in child theme? [closed]
- How to display home page last modified date in anywhere of wordpress theme?
- What is an alternative to not using child theme to customize a WordPress theme?
- (Parent) theme Is Not Showing In Theme Selection Panel and Therefore Breaks Child Theme
- Child theme menu not appearing in Twenty Seventeen
- How can I fix my theme header for my CSS stylesheet?
- How to test another theme in a live WordPress website instead of live preview?
- Update modified Shopify third-party theme [closed]
- Can’t upload images on new theme
- how can I re-utilize and class on a child theme
- Providing updates to your WordPress theme
- How do child themes work?
- How to migrate the menu from the site on my own theme in WordPress?
- adding navigation to genesis themes
- Retina ready for uploaded images which are cropped
- Standard Way To Do Custom Work Within A Page?
- Image Size wrong during upload
- Confusion about theme’s parent and child functions.php file
- Random white space before doctype
- How to obfuscate theme directory URLs
- Adding a gallery to my first theme
- How to add menù section to my WordPress template?
- Why would changing a child theme to a normal theme pass a Template is missing. error
- What are the critical theme files when building a custom theme?
- Remove link on full-size images
- Having issue with WordPress wp_enqueue_style
- How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?
- How can I hard code my sidebar?
- What exactly is “wordpress theming”? [closed]
- Theme Development -> Specific Homepage
- Making a WordPress theme based on twentyten
- Thesis -style Navigation
- registering a global template wordpress 6.0
- Making a child theme for “Airi”
- How can I wrap all blog posts image with
- theme style is applied on the dhasboard rather than the website
- How to change footer credit text in Twenty Twenty One theme with a hook?
- how to retrieve the image title for image Post Format
- Warning: printf(): Too few arguments in helpers.php file
- Copying the theme style files and images to duplicate the website but with a difference
- Do I need to create a child theme for JointsWP
- I have WordPress setup on primary domain, how do I set it up on its subdomain using the same database?
- Hestia Child theme creation
- Which cache is kicking
- How to set Post meta-box defaults based on the choices made by user in Customizer?
- Theme Action to hook for one time only function [duplicate]
- Why is switching between themes breaking my child theme?
- Avada Child Theme Development
- Questions from a new WP Dev [closed]
- searchform.php doesn’t work properly
- Issue when posting updates/changes to wordress
- How to override template files in parent theme?
- Theme logo metadata into template file