This is test post. There’s an enclosure attached to this post so take a look at my rss2 feed to find it!
Add the URL of the enclosed media file by pasting it into the “Enclosures” text field. WordPress will figure out how big the file is, and the type of file automatically and save that data in a custom field. You can edit that data later through the usual custom field interface.
Because a remote server has to be contacted, it may take longer than usual to save posts with enclosures! This is normal, so wait until the page has completed loading!
Read more on enclosures to find out why they’re useful.
Currently, you have to add the enclosure in the “Enclosures” text field in the following format:
url_length_type or as an example: http://blogs.linux.ie/download/referers.gif_126007_image/gif
Thanks Matt for pointing out I had a problem with the “Host” line of my code – I left out the “:”
As an exercise I created an “enclosure” custom field handler. It returns the details of the custom field in an array which I print using the following Smarty code in post.html under the call to {custom_fields}:
{if $enclosure != ''}
<blockquote><b>Attached Enclosure</b><br />
File: <a href="{$enclosure.0}">{$enclosure.0}</a><br />
Length: {$enclosure.1} bytes<br />
Type: {$enclosure.2}<br /></blockquote>
{assign var='enclosure' value=''} <!-- reset enclosure variable again! -->
{/if}
7 replies on “Enclosures in WordPress”
Oh nice, glad to see you got the enclosure stuff working.
WordPress Multiuser 0.1.3
Calendar Script Tutorial
Swans in Ballydehob
Learning to See
Enclosures in WordPress
The Global Test
Savant : […]
Enclosures and Instant Preview Donncha has been busy adding support for enclosures and instant preview. The pace of development has been picking up now t […]
Enclosures voor WordPress (7)
Eindelijk word er eens gekeken binnen het wordpress-forum naar het inbouwen van Enclosures. Ik volg de discussies regelmatig en ik merk dat WordPress nog niet echt weet waar Enclosures voor gebruikt moeten worden. Van 1 persoon heb ik op het forum ook…
Great Work dude,
This is why i posted the question in the WordPress-forum a month ago :)))
My knowledge of the WordPress backend is not yet that good, so i’m glad someone could create this function / feature.
Enclosures is getting important for the blogosphere.
http://www.bernardflach.com/2004/10/12/148/
˜ã?•れã?¦ã?¾ã?™ã€‚ ã?“れã?£ã?¦ã€?何ã?ªã?®ï¼Ÿ ã?©ã?ªã?Ÿã?‹æ•™ã?ˆã?¦ã??ã? ã?•ã?„。 「Enclosures in WordPressã€?を見るã?¨æ·»ä»˜ãƒ•ァイルを簡å?˜ã?«ã?™ã‚‹ã?£ã?¦æ„ […]
[…] Anyway, I found a page detailing how to set up enclosures, but it wouldn’t work for me. It turns out there is an array of arrays, and these need to be stepped through. […]