{"id":728,"date":"2021-01-20T15:46:25","date_gmt":"2021-01-20T15:46:25","guid":{"rendered":"https:\/\/crocoblock.com\/knowledge-base\/?post_type=article&#038;p=728"},"modified":"2025-01-31T07:39:08","modified_gmt":"2025-01-31T07:39:08","slug":"fail-to-output-a-url-in-the-media-field","status":"publish","type":"tips-and-tricks","link":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/","title":{"rendered":"Outputting a URL in the Media Field"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"download-and-activate-the-plugin\">Download and Activate the Plugin<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\"><div class=\"wp-block-group__inner-container\">\n<p class=\"offset\">Upload it to the <strong><em>WordPress Dashboard &gt; Plugins &gt; Add New<\/em><\/strong> directory and activate the plugin once done.<\/p>\n\n\n<div class=\"note-banner d-flex border-bold border-jetthemecore rounded overflow-hidden p-20\"><div class=\"mr-12\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M9 21C9 21.5 9.4 22 10 22H14C14.6 22 15 21.5 15 21V20H9V21ZM12 2C8.1 2 5 5.1 5 9C5 11.4 6.2 13.5 8 14.7V17C8 17.5 8.4 18 9 18H15C15.6 18 16 17.5 16 17V14.7C17.8 13.4 19 11.3 19 9C19 5.1 15.9 2 12 2Z\" fill=\"#F2D23C\"\/><\/svg><\/div><div class=\"d-flex flex-column\"><div class=\"text-900 mb-12\">Things to know<\/div><p class=\"m-0\">If you want the attachments to be opened in a new tab, please make sure to modify <a href=\"https:\/\/github.com\/MjHead\/jet-engine-attachment-link-callback\/blob\/master\/jet-engine-attachment-link-callback.php\">this file<\/a> a bit. In the line 60, return sprintf, add a target=\"_blank\" attribute like so: <\/p><\/div><\/div>\n\n\n\n<pre class=\"wp-block-code offset\"><code>return sprintf( '&lt;a href=\"%1$s\" target=\"_blank\"&gt;%2$s&lt;\/a&gt;', $url, $name );<\/code><\/pre>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"check-meta-field-settings\">Check Meta Field Settings<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<p>First, head to <strong><em>WordPress Dashboard &gt; JetEngine &gt; Meta Boxes<\/em><\/strong> and open the meta box you work with. If the meta box was built in another directory, go there.<\/p>\n\n\n\n<p>Scroll down to the <strong>Meta Fields <\/strong>section and check your <a href=\"https:\/\/crocoblock.com\/knowledge-base\/features\/meta-field-types-overview\/#media\">&#8220;Media&#8221; meta field<\/a> settings. <\/p>\n\n\n<div class=\"note-banner d-flex border-bold border-jetthemecore rounded overflow-hidden p-20\"><div class=\"mr-12\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M9 21C9 21.5 9.4 22 10 22H14C14.6 22 15 21.5 15 21V20H9V21ZM12 2C8.1 2 5 5.1 5 9C5 11.4 6.2 13.5 8 14.7V17C8 17.5 8.4 18 9 18H15C15.6 18 16 17.5 16 17V14.7C17.8 13.4 19 11.3 19 9C19 5.1 15.9 2 12 2Z\" fill=\"#F2D23C\"\/><\/svg><\/div><div class=\"d-flex flex-column\"><div class=\"text-900 mb-12\">Things to know<\/div><p class=\"m-0\">The addon works only with those meta fields that store value as IDs so make sure that the <strong>Value format<\/strong> field is set to \"Media ID\". Otherwise, the needed result will not be achieved.<\/p><\/div><\/div>\n\n\n\n<div class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/media-id-field-settings.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/media-id-field-settings-1024x640.webp\" alt=\"media id field settings\" class=\"wp-image-46928\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/media-id-field-settings-1024x640.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/media-id-field-settings-300x188.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/media-id-field-settings-768x480.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/media-id-field-settings-1536x960.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/media-id-field-settings-600x375.webp 600w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/media-id-field-settings.webp 1824w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/div>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"edit-the-necessary-listing\">Edit the Necessary Listing<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\"><div class=\"wp-block-group__inner-container\">\n<p class=\"offset\">Go to <strong><em>WordPress Dashboard &gt; JetEngine &gt; Listings\/Components <\/em><\/strong>and open the <strong><a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-create-a-listing-template-for-post-types\/\" target=\"_blank\" rel=\"noreferrer noopener\">Listing<\/a> <\/strong>you need in Elementor.<\/p>\n\n\n\n<p class=\"offset\">Add the <strong><a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/dynamic-field-widget-overview\/\">Dynamic Field<\/a><\/strong> widget to it. <\/p>\n\n\n\n<p>In the <strong>Source <\/strong>drop-down, choose \u201cMeta Data\u201d. Then, select the custom <strong>Media field<\/strong> you\u2019ve created with <em>JetEngine <\/em>(it\u2019s called &#8220;Media ID Field&#8221; in our case, but yours can be named otherwise) in the corresponding drop-down. <\/p>\n\n\n\n<p>Enable the <strong>Filter field output<\/strong> toggle. In the <strong>Callback <\/strong>field, make sure to select the \u201cGet attachment file link by ID\u201d option.\u00a0<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/dynamic-field-callback-settings-in-elementor-1.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/dynamic-field-callback-settings-in-elementor-1-1024x640.webp\" alt=\"dynamic field callback settings in elementor\" class=\"wp-image-46930\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/dynamic-field-callback-settings-in-elementor-1-1024x640.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/dynamic-field-callback-settings-in-elementor-1-300x188.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/dynamic-field-callback-settings-in-elementor-1-768x480.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/dynamic-field-callback-settings-in-elementor-1-1536x960.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/dynamic-field-callback-settings-in-elementor-1-600x375.webp 600w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/dynamic-field-callback-settings-in-elementor-1.webp 1824w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/div>\n\n\n\n<p class=\"offset\">That&#8217;s all. Now, the link to your media file will be displayed in the listing as needed with the help of the <strong>Attachment link addon <\/strong>from <em>JetEngine <\/em>for WordPress.<\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Follow this tutorial if you need to output a media file like a link from the media field type.<\/p>\n","protected":false},"author":11,"featured_media":0,"template":"","format":"standard","tipstricks-tags":[359],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Quick Way to Display Links to Files in Media Field Type | Troubleshooting<\/title>\n<meta name=\"description\" content=\"Follow this 3-step guide and learn how to output a link to the media file instead of the file itself in the JetEngine Media field type.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quick Way to Display Links to Files in Media Field Type | Troubleshooting\" \/>\n<meta property=\"og:description\" content=\"Follow this 3-step guide and learn how to output a link to the media file instead of the file itself in the JetEngine Media field type.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/\" \/>\n<meta property=\"og:site_name\" content=\"Help Center\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-31T07:39:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/media-id-field-settings-1024x640.webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/\",\"name\":\"Quick Way to Display Links to Files in Media Field Type | Troubleshooting\",\"isPartOf\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\"},\"datePublished\":\"2021-01-20T15:46:25+00:00\",\"dateModified\":\"2025-01-31T07:39:08+00:00\",\"description\":\"Follow this 3-step guide and learn how to output a link to the media file instead of the file itself in the JetEngine Media field type.\",\"breadcrumb\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tips & tricks\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Outputting a URL in the Media Field\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/\",\"name\":\"Help Center\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/crocoblock.com\/knowledge-base\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#organization\",\"name\":\"Help Center\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg\",\"contentUrl\":\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg\",\"caption\":\"Help Center\"},\"image\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Quick Way to Display Links to Files in Media Field Type | Troubleshooting","description":"Follow this 3-step guide and learn how to output a link to the media file instead of the file itself in the JetEngine Media field type.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/","og_locale":"en_US","og_type":"article","og_title":"Quick Way to Display Links to Files in Media Field Type | Troubleshooting","og_description":"Follow this 3-step guide and learn how to output a link to the media file instead of the file itself in the JetEngine Media field type.","og_url":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/","og_site_name":"Help Center","article_modified_time":"2025-01-31T07:39:08+00:00","og_image":[{"url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/media-id-field-settings-1024x640.webp"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/","url":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/","name":"Quick Way to Display Links to Files in Media Field Type | Troubleshooting","isPartOf":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#website"},"datePublished":"2021-01-20T15:46:25+00:00","dateModified":"2025-01-31T07:39:08+00:00","description":"Follow this 3-step guide and learn how to output a link to the media file instead of the file itself in the JetEngine Media field type.","breadcrumb":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/fail-to-output-a-url-in-the-media-field\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crocoblock.com\/knowledge-base\/"},{"@type":"ListItem","position":2,"name":"Tips & tricks","item":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/"},{"@type":"ListItem","position":3,"name":"Outputting a URL in the Media Field"}]},{"@type":"WebSite","@id":"https:\/\/crocoblock.com\/knowledge-base\/#website","url":"https:\/\/crocoblock.com\/knowledge-base\/","name":"Help Center","description":"","publisher":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/crocoblock.com\/knowledge-base\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/crocoblock.com\/knowledge-base\/#organization","name":"Help Center","url":"https:\/\/crocoblock.com\/knowledge-base\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/","url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg","contentUrl":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg","caption":"Help Center"},"image":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/tips-and-tricks\/728"}],"collection":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/tips-and-tricks"}],"about":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/types\/tips-and-tricks"}],"author":[{"embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/users\/11"}],"wp:attachment":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=728"}],"wp:term":[{"taxonomy":"tipstricks-tags","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/tipstricks-tags?post=728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}