You can debug the result of attachment by :
console.log(attachment);
and if the thumbnail size available you can retrieve it using :
var thumb = attachment.sizes.thumbnail.url;
alert(thumb);
Related Posts:
- WordPress uploads do not show up and I see the white screen of death in some cases
- How to add custom css file in theme?
- get_template_part vs action hooks in themes
- Do I actually need to link my theme’s style.css in the theme files
- How to remove search bar from a wordpress theme? [closed]
- My child theme doesn’t work Error: “The parent theme is missing. Please install your parent theme”
- How To Add New Option Types To Option Tree?
- Theme file for all pages that are a child of a specific page
- Child Theme not loading parent CSS
- Where do I find the functions triggered within a hook?
- How to show next Post Thumbnail image in WordPress using current post id
- Registering Sidebars and Sidebar Widgets. Sidebar Widgets Not Displaying
- First post of each category
- index.php is not loaded for single posts
- WordPress website loads but is not displayed until page scrolled
- Create a theme by combining a parent and a child theme
- Theme Customizer not loading
- How to add oEmbed support to my theme?
- Is it a good idea to make whole theme widgetized?
- How Can I Create a List of Values to Be Iterated Through via WordPress Customization API?
- Where is definied the theme location for the main menu in a WordPress template?
- 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?
- How to disable automatic colors in the Twenty Twenty theme?
- What are non-printable characters doing in my theme?
- Gutenberg – editor-font-sizes in functions not working
- Cannot figure out how to overwrite files in child theme
- Customize the previous_post_link output
- How to use get_template_part instead of include_once?
- How to remove comment link title attribute?
- How can I let templates choose which stylesheets are enqueued?
- wp-cli: For development, how can I activate a theme that is on the local disk but not zipped?
- My Admin bar covers my sticky navbar [closed]
- Lightweight framework [closed]
- Single Page Design, Storing in Theme Options
- How to edit my theme for full width?
- loading blank white screen of slide
- Child Theme’s style.css not loading in mobile browser
- Echo all category names, apart from one
- How to Find the Page the Front Page is Using?
- Add attachment for all images in post
- Customizer – loading settings/controls/sections/panels based on a id/page id
- How do I get the trackback count of a post in wordpress without writing an SQL query?
- Overrite parent functions using child functions
- Does code in function.php differ from theme to theme
- 3 Level Deep Navigation Menu Not Showing All Levels
- How can I change the theme of different posts using a plugin?
- How to Have a Pure HTML Sub Directory In WP Site
- Theme not showing up
- Theming Using Bootstrap Glyphicons and WordPress Dashicons
- Change image size depending on page
- WordPress page/blog incorporated into static website
- Random white space before doctype
- How to add menù section to my WordPress template?
- Starting point for custom Themes [closed]
- Theme Development -> Specific Homepage
- Why still output /wp-content/themes/twentynineteen?
- get_header action not working
- Unable to change the priority with ‘remove_action’ and ‘add_action’ in child theme
- How add built-in textarea in theme development?
- Remove h1 from 2015 theme
- WordPress pulling in random page themes
- Some doubts about WordPress handle the horizontal main menu visualization
- Filter didn’t work on content class (hybrid_post_attributes)
- Can’t change theme name
- How to remove permalinks links presents in each page of my site?
- Is there a way to serve different resolution images to different devices?
- How to make a function occurs for one time?
- How do I restructure the comment HTML layout?
- Trying to link to a php template file but its blank
- “The REST API did not process the context query parameter correctly.” Custom theme conflicting with Media Library
- Theme author.php transfer
- Theme: dropdown hover menu not showing up in IE/Edge
- Problem with pagination link (error 404)
- how to ensure responsiveness in wp themes? [closed]
- home is not working in wordpreess
- 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
- Can’t upload images on new theme
- Any way to permanently translate themes?
- New created Theme leads to malfunctioning Xampp Apache –> functions.php is cause
- WordPress Blog Page displaying nothing
- Primary Menu Showing All Pages With No Sub-Nav
- Magnific Popup – Add Caption to Images
- Why do WordPress developers use so many opening and closing PHP tags when developing themes? [duplicate]
- Safe way to echo wp_trim_words
- Theme Development : License help
- How can I demonstrate themes well?
- How to update my own theme?
- WordPress custom jquery not found
- Displaying Tags for the Page I’m On?
- Custom link color or stylesheets
- Showcase your wordpress themes [closed]
- How to remove proudly created by WordPress in theme?
- Roll my own theme or customize an existing one [closed]
- Why do some sites show themes/”themename” as the only theme?
- How to automatically set a Template Page Name next to a page in menu screen such as WooCommerce pages, front page, or posts page in wordpress?
- How do I send out an update for my custom wordpress theme?