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
- How to add custom css file in theme?
- How to remove search bar from a wordpress theme? [closed]
- Should I use set_transient or update_option?
- How to add Color Picker in Theme Options for the following?
- Template for individual post designs
- Best practice way to implement custom sections into a WordPress theme
- Override default cropping in WordPress [duplicate]
- First post of each category
- How to set dimensions of the post thumbnails (featured images)
- How Can I Create a List of Values to Be Iterated Through via WordPress Customization API?
- If I build a custom theme, will it update?
- Recommended tools for Theme Development with SASS [closed]
- What tags should be used for themes to show the type of layout?
- What are non-printable characters doing in my theme?
- How can I let templates choose which stylesheets are enqueued?
- Lightweight framework [closed]
- Injecting a custom sql query into a page/theme
- How to edit my theme for full width?
- Echo all category names, apart from one
- Does code in function.php differ from theme to theme
- Theme not showing up
- Translate a child theme with pure PHP and gettext
- WordPress pulling in random page themes
- Can’t change theme name
- How to remove permalinks links presents in each page of my site?
- Stop WordPress from showing images on non post pages
- How to make a function occurs for one time?
- Problem with pagination link (error 404)
- Is there a way to create sections under “Colors” panel in the Theme Customizer?
- Local theme changes upload on server but theme changes not showing
- WordPress Custom font not found
- WordPress Blog Page displaying nothing
- Magnific Popup – Add Caption to Images
- Why do WordPress developers use so many opening and closing PHP tags when developing themes? [duplicate]
- Custom link color or stylesheets
- How do I send out an update for my custom wordpress theme?