Use add_image_size()
:
add_image_size( 'custom-name', 123, 456, true );
…will create image size custom-name
, with dimensions of 123x456px, hard-cropped.
Edit
Re this comment:
Thanks for comment but honestly I got more confused!can you please let me know what is the ‘custom-name’? How I can associate this name with Gallery thumbnails?
The custom-name
is arbitrary. It’s whatever you want it to be. You could call it gallery-thumb
, if you want to:
add_image_size( 'gallery-thumb', 123, 456, true );
Then, you would output that image size by passing gallery-thumb
to the_post_thumbnail()
:
the_post_thumbnail( 'gallery-thumb' );
In your case, I assume you’re using the core WordPress shortcode? If so, you can pass the
size
attribute:
Related Posts:
- Allowing for multiple template views on the Gallery Settings page when using the Visual Editor
- Build path for a custom portfolio plugin
- Add an image gallery to a custom post type?
- Having Problem On Getting WP Post Gallery Images URL
- Modify how gallery.js builds the shortcode [gallery ...] in tinyMCE?
- How to Display Custom Post Type’s Gallery (images ) in Through WP_Query
- Adding option to Gallery shortcode
- How to Find a Gallery’s ID
- How do I show the HTML descrption in wordpress photo gallery for my individual gallery pages?
- Issue on Getting Images URL of the Post Gallery
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- What process do you use for WordPress development? [closed]
- How do I create a custom role capability?
- What is the advantage of using wp_mail?
- Where to put third party PHP library?
- Add a new tab to WordPress Plugin install Listing
- Export data as CSV in back end with proper HTTP headers
- How to integrate a PHP webmail script into the backend of WordPress?
- Calling the widget id of a mult-instance widget from inside the widget?
- How to Get a List of Sub Blogs without Using get_blog_list()?
- Do I need to call do_action in my plugin?
- WooCommerce get Shipping Class of product from either the product id or the order after order is completed
- Dequeue script, but still use wp_localize_script to pass vars
- I can’t find where a hook is being defined in a plugin – Easy Digital Downloads
- Can I add pages to my custom menu via script?
- Replacing WordPress menu functionality with a plugin
- Programmatically Selecting Theme Based on URL
- Custom Plugin Database relations
- Save user-specific options in WordPress admin
- Why is print_r returning $classObj->userObj in several places on site
- Is it possible to load plugin from console with core ?
- use __($str) to translate strings (symfony/twig)
- Plugin development: is adding empty index.php files necessary?
- Plugin base URL
- Database for development
- Customize multisite site creation with user data
- Adding plugin settings link upon activation
- How to create multiple Gutenberg blocks in one plugin
- How to disable reCaptcha v3 except on Contact Form 7 pages?
- Proper way to run wp_query from inside a plugin
- Buddypress function and global $bp question
- Custom plugin: Loop through taxonomy types and update columns for all types?
- How to add setting section in custom post type [closed]
- Get Current Menu Location inside Nav_Walker
- Maximum lifetime for nonce
- How to Display my HTML form in my Custom Plugin?
- Where to add hooks in a class
- Insert terms for custom taxonomy on plugin activation, or each page load (init hook)
- Custom GET Parameters In Plugin’s Admin Page
- Adding rewrite rule dynamically
- Incorporate small angular feature in my wordpress site
- Bootstrap doesn’t work on admin menu page-How to override wp-admin style?
- Use just a shortcode from another page
- How can I avoid conflicts between plugin and theme?
- How to control an elements classes from multiple Gutenberg sidebar controls?
- WordPress class, using add_action to call member function does not work
- random code at the end of file after plugin upload
- How Can I add Fields in wp-option table?
- Where do I put my add_action(… and add_filter(… and do I need to remove them?
- $wpdb->prepare with LIKE and sprintf
- ajax recursive calls on wordpress returning answers outsite the function scope
- Why in this archive page that call query_posts() function show only the last 10 posts?
- How to create a digital product download link that can’t be used twice?
- Working of foreach loop with array
- How to change a field in database through a submit button or Checkbox? [closed]
- Grandchildtheme (plugin) add header.php (not exist in child theme)
- Submit form to a different PHP file in the same plugin folder
- $wpdb->update Issue
- wp_insert_post generated mixed permalinks
- Adjust query on single
- Is there any way to pass messages from a script to a redirect target in a hidden fashion?
- What should I pass for $needed_dirs when calling _unzip_file_pclzip (aka PclZip)?
- Custom Path for a Plugin
- How to make every image title equal to alt text(wordpress/woocommerce)?
- Load specific page when a custom URL is hit
- Trigger function on Remove block or add new block in Gutenberg JavaScript
- Trying to rename a file upload as the hash of file content on wordpress
- Getting products information, in woocommerce based on products ID
- How the add_action is included in the plugin development
- Fatal error: Uncaught Error: Using $this when not in object context
- How can I measure CPU and RAM used by my theme or plugin
- want to confirm popup with “Yes” and “No” button when user click on add to cart
- do I need to sanitize a shortcode’s function input?
- Email content as comment
- Warning: Illegal string offset – on homepage
- Modify search form with plugin
- Organising and completing posts (mark as read and hide)
- When using an options array the Settings API isn’t creating the database record
- Displaying External Data – Not Posts
- the correct way to use options from settings page [closed]
- On one of my sites a file is shown as 404 but the file IS there
- I want to add post meta for picture thum during submit for revision
- How to synchronize an e-commerce site and a pharmacy management software?
- woocommerce features to add product along with link
- Extend WP_List_Table class – Edit wp_usermeta – WPPB.me Boilerplate – Action error
- Is there a canonical way for a plugin to install a mu-plugin or drop-in?
- How can create a custom plugin to call my webapi after any registration or membership plugin functionality
- Calling get_header() with installed FSE theme
- Reinitiate Gutenburg’s blocks using javascript
- Generating Multiple Divi Pages from Database