That is one strange add_image_size()
call. You are missing size’s name and mixing up string with integer. And you specify crop mode, when you actually need resize mode. Try this:
add_image_size( 'portfolio-shot', 640, 9999 );
Then fetch it with:
the_post_thumbnail( 'portfolio-shot' );
This should properly register image size under portfolio-shot
name in soft-resize mode to width 640px. Note that (unless there were changes in recent WP versions, not sure) new size will be effective only for new uploads.
See this tutorial for excellent writeup on using related functions:
Related Posts:
- How to get the Date Format and Time Format settings for use in my template?
- Users with custom roles not showing in post author select box
- Are there any forks of WordPress (and what is different about them)?
- How to Change 404 page title
- How to remove comment section from page only , not from posts pages?
- Archive Listings Filtered by Date Values in a Custom Field/Post Meta?
- How can I remove the sitename or homepage title from all page titles?
- deleted users still show in count?
- How to deal with multiple select options using register_setting() theme options
- Why isn’t is_home() working correctly?
- Custom sidebar category listing?
- Any amazing WordPress MultiSite sites? [closed]
- Add URL field to the link post format
- How to fix broken upgrade to 3.1
- Disable email field on WooCommerce customer account details
- Multiple Queries and Excluding Repeating Posts?
- Add new Control to Customizer to modify Headings (h1, h2, h3…) Color
- Is there a filter hook that I can use to change how taxonomy term names are displayed?
- Custom Theme Blog page not showing Posts
- Gutenberg Blocks – Attributes from comment delimiter or from HTML?
- get_option issues
- How to change URL Custom Page?
- Comments not nesed with custom template
- How to get multiple Action Hooks in an Array
- What values can we use in `formattingControls` parameter in RichText component
- What will happen to the additional CSS when the theme is updated?
- Multiple Blogs on one site. Best Practise
- Limiting allowed html elements/strip harmful scripts from editor
- WordPress generated links – menus and home_url() – not using https despite settings
- How to use
- Name/Word Replacement Plugin
- Get page ID outside the loop, matching menu ID
- Gallery IDS and Captions: hide/show on a per ID basis
- How to check if a custom user profile field is empty
- Properly customizing login/register form
- Author Tracking Code!
- Change the Labels of Users to Customers in Admin
- help to change some colors (woocomerce and store locator) [closed]
- Show Featured Post Only On The Homepage
- How can I create a second multisite network in a subdirectory?
- order event posts by multiple custom fields
- Custom Role with Own Page Edit Capability
- List top 5 authors with most posts
- CSS Styling a specific page
- How to remove footer from just homepage
- How can I start over on my site? [closed]
- Plugin to allow registered users to customize their layout [closed]
- Can Username and Password be passed to WP Login page in an IFrame?
- Returning or use form data using a hook?
- Custom Columns WordPress Admin
- If custom image header does not exist display text header
- Get users based on month ACF datepicker field
- Trigger Customizer Publish (save) Action
- Edit value=”” of a button in child theme
- External Link Button Under Post Excerpt on Index.php
- Creating php pages in wordpress and assigning them to wordpress pages
- Showing different pages depending on a cookie value
- WP function duplicating body content
- Custom blog setting directs blog to index page
- WooCommer Product Category Loop – How to change the display order of the rating and price?
- How to Remove the Custom Theme Panel from a Theme?
- Replace TimThumb in existing WordPress Themes
- Moved wp-content and got problem with themes directory?
- title tag function
- How to do multi site setup
- WordPress search on a custom table
- Is it possible to edit a wordpress category with Gutenberg?
- How to change Login default blue admin color?
- How do i remove this from logged in users?
- Schedule a subscription on gravity form, stripe add-on
- How to show related post with category DESC (ASC) IDs of ID current post
- Twenty Twenty edit “Read more” text
- Some questions about best practices for custom code
- I want to change url structure of my created archieve pages
- Simple Add To Cart Ajax Button
- How to prepend block content in getSaveElement filter?
- Upload advanced custom field text link array with csv
- Advice on how to structure a custom plugin
- How can I delete the word `Category:` from page titles? [duplicate]
- How can I add category variable inside posts?
- Create page when a new site in multisite network is created?
- Figuring out how to create “Option Pages” in WordPress admin
- Including a Customized Initialize File with a wordpress header
- Link to a new page into a plugin
- How to create custom post type selection to nav menu
- How do I change the content of an element for a theme without losing the styling?
- Change the – WordPress from titlebar?
- I can’t override CSS
- How to replace specific word in wordpress without losing their functionality
- Url rewriting on custom post with CPT UI plugin
- Responsive menu not expanding in footer
- Add field to post form
- Create dashboard setting which lets me set ID of category which is inserted into template
- Setting variables as custom field values
- How to restore deleted wordpress site?
- Which IDE best for WordPress Development? [closed]
- How do I fix the url when clicking on portfolio item?
- customizing a theme [closed]
- Particle.js not loading in WordPress Gutenberg
- Why after customizing Home Page, the site is loading six missing blob sources, slowing down all site?