The GUID field is not a URL and should never be used for that purpose. It’s a unique identifier that happens to look like a URL, but it should never be trusted as such.
WordPress has a number of functions for retreiving attachment URLs and files:
The function wp_get_attachment_image
is probably what you’re looking for in this case.
Related Posts:
- Custom post status not working
- How do you output custom code between posts in the loop?
- Get rewrite slug of custom post type in template
- Redirect to another page using contact form 7? [closed]
- How exclude or skip post type with get_next_post_link
- post_content is stripping HTML when adding a new post? [closed]
- Stored meta from attachment, video length?
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Get custom post type by category in a page template
- Redirect after deleting post and keep track of pagination
- Date archives for custom post type
- How can I add dropdown widget/box to admin post page?
- Custom post type loops with different page templates
- Error after deleting Custom Post Type with a function (no trash used)
- Row actions not showing? Why?
- Append taxonomy terms as class names in markup?
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- How to append element after thumbnail
- How to get Custom Post ID by adding filter to child theme’s function
- Dynamic Custom Post Type Plugin
- Loop through posts of a custom-post-type (event) and create .ics (iCal) file?
- Custom Post Type | Fatal Error on register_post_type()
- Output custom post shortcode. Help spot the error.
- GravityForm: Populate Dropdown with custom post type [closed]
- Weird problem happening with custom taxonmy when creating/updating posts
- Admin notice not displaying
- What’s the difference between same wp functions get_posts(); functions in different form?
- custom post type not showing in menu
- Plugin: register custom post types, child ready and performance best practices
- Edit Yoast SEO breadcrumbs output [closed]
- AJAX load more for different custom post type loops
- I need to add endpoint for wordpress categories
- Use custom metabox to update automatically a post after a given date
- get_post_meta not working on publishing
- WordPress wrapped added a span tag to every single p tag
- ACF field key/value to show on taxonomy list
- Hide a widget inside a div on specific type of post
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- Cannot save CPT meta box
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Different Category system needed for the Custom Post Type
- categories should be available across all custom post types
- What exactly do this function declared into functions.php file of a WP theme?
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- PHP question: how to combine syntax?
- Loop increase number
- custom post for slider
- ACF in wordpress
- Assign category a default post type
- Show current custom taxonomy
- How to insert data into meta box from another plugin?
- How do I add custom HTML to the content of an archive page’s posts?
- Create short URL with auto 301 redirect
- Custom post type’s posts are not showing anywere but in xml sitemap
- Removing full title and breadcrumb header container for a specific post type
- Is it possible to use array_walk() to append terms to an array of posts?
- Show current user posts in custom post type query
- Custom post type in Custom widget – $listItem
- Validate Custom Post Type fields
- Convert Custom Table Data Based Plugin To Be Searchable
- Function to add custom HTML into head in custom post-type list page
- Post type Echo code is repeating on homepage
- redirect after submiting post for review
- set object terms after some some time of published post – functions.php
- Why is my custom post content only viewable when signed into WordPress?
- update custom taxonomy custom fields
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- Title and URL Error in Breadcrumb Navigation for Custom Post Types
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- Pagination not working in custom post type. Help
- How to add specific terms in a custom post type?
- Plugin Development using classes – Public & Private Callbacks
- Assigning categories to custom post types via a front-end form; only works for native post type
- How to limit the number of custom posts certain users can publish in WordPress using php script?
- Limit custom post type to the authors only on front-end!
- Create posts inside CPT post
- ACF field check value of field on all other articles
- Change Search display for Custom Post Type
- Having issue on Loading Meta Data From CSV to CPT
- Duplicate posts in my custom loop
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- Featured image in custom post is being disabled
- can’t see categories in appearance-menu-categories
- call_user_func_array() error after moving to another server
- Registering an optional custom post type from a plugin
- Add Excerpt On Quicksand Plugin
- Select Menu for Custom post Type does not save
- Multiple Block Quotes without using HTML
- How to apply order on custom taxonomy and custom meta key on custom post type
- Code in custom widget queries all posts, when it should only query the current post
- Add HTML before a specific div?
- Inserting two categories
- Set a Custom Post Type as a Homepage
- Comments are not working on Custom Post Type
- WP Custom tables query
- how to display custom taxonomies in front page
- add_rewrite_rule not working with custom post type
- How do loop categories post from according in WordPress? is it impossible to solve this problem?
- I want to show a list of post with title that have link goes to that post and icon under the specific category to which it belongs
- How to display *block number* instead *date value* on WordPress posts?