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
- Display a query with multiple post types and same relationship on a single page
- WordPress Custom Post Types with a page as a parent?
- 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?
- White screen error for a custom theme
- Custom post type loops with different page templates
- Remove POST_TYPE from custom post type permalink
- Limit Authors to their Own Posts on front-end excluding admins
- 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 to: add option to add more checkboxes on custom post type
- 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]
- Loading all files within a directory
- PHP can I add line numbers to file_get_contents()
- Weird problem happening with custom taxonmy when creating/updating posts
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- 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
- Add an Outside Wrapper to my Header and Make it Full Width
- How to use a variable as a function name?
- Show current custom taxonomy
- How to insert data into meta box from another plugin?
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- 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?
- Creating a non-hierarchical Taxonomy that behaves like categories
- Show current user posts in custom post type query
- Custom Ratings for Theme, Proper way to Refactor Code and Clean up Template File
- Custom post type in Custom widget – $listItem
- Validate Custom Post Type fields
- Using Wp_Query, Json to add Highcharts series data
- Template code to split a post and print a custom field?
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Convert Custom Table Data Based Plugin To Be Searchable
- Let users upload image(s) to the post from front end
- Foreach loop returning more than one item when querying taxonomy
- Function to erase every post from a taxonomy
- Post visibility option to theme front-end for author to select?
- Function to add custom HTML into head in custom post-type list page
- Post type Echo code is repeating on homepage
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- How do I ensure that post_type and Taxonomy use the same slug?
- Custom post type page with parameter
- redirect after submiting post for review
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Custom Form / Search with Custom Post Type Data
- How to show the post which checkbox is not selected
- Is it possible to get the specific content on the search page?
- set object terms after some some time of published post – functions.php
- php dynamic content inside shortcode
- 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
- Check that a slug is present in the get_terms request
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- WordPress query posts by custom post type not workng
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- 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
- Function not pulling image or text from custom post type
- Add category slug as class attribute in a link array
- 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
- Custom Loop for custom post type. Compare by meta_value?
- Code in custom widget queries all posts, when it should only query the current post
- Custom post type functions.php if statement on action
- Add HTML before a specific div?
- Inserting two categories
- How to string lines from the_content() hook in WordPress?
- Set a Custom Post Type as a Homepage