{"id":8053,"date":"2010-02-11T02:50:17","date_gmt":"2010-02-11T02:50:17","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/use-the-attachment-image\/"},"modified":"2021-04-09T23:41:00","modified_gmt":"2021-04-09T23:41:00","slug":"use-the-attachment-image","status":"publish","type":"plugin","link":"https:\/\/ur.wordpress.org\/plugins\/use-the-attachment-image\/","author":68490,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.02","stable_tag":"trunk","tested":"5.7.15","requires":"2.7","requires_php":"","requires_plugins":"","header_name":"Use the Attachment Image!","header_author":"Tom Lany","header_description":"","assets_banners_color":"","last_updated":"2021-04-09 23:41:00","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/tomlany.net\/code\/","header_author_uri":"https:\/\/tomlany.net\/","rating":5,"author_block_rating":0,"active_installs":20,"downloads":5185,"num_ratings":3,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":{"1.0":{"tag":"1.0","author":"tomthewebmaster","date":"2010-02-23 17:32:30"},"1.01":{"tag":"1.01","author":"tomthewebmaster","date":"2010-12-31 04:16:29"},"1.02":{"tag":"1.02","author":"tomthewebmaster","date":"2018-12-28 05:21:18"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"3"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.01","1.02"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[16802,133,8397,1326],"plugin_category":[41,50],"plugin_contributors":[89496],"plugin_business_model":[],"class_list":["post-8053","plugin","type-plugin","status-publish","hentry","plugin_tags-attachment-image","plugin_tags-image","plugin_tags-magazine","plugin_tags-thumbnail","plugin_category-communication","plugin_category-media","plugin_contributors-tomthewebmaster","plugin_committers-tomthewebmaster"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/use-the-attachment-image.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Use the Attachment Image! allows the first attachment image associated with a post to be displayed nearly anywhere on a blog, simply by adding a special function to a loop. This plugin is a perfect compliment for magazine themes.<\/p>\n\n<p>This plugin can include images of nearly any size, simply by using the included <code>&lt;?php use_the_attachment_image(); ?&gt;<\/code> function. See the installation page for more details regarding usage.<\/p>\n\n<!--section=installation-->\n<p>To utilize this plugin, you will first need to upload <code>use_attachment_image.php<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory on your web server; and activate the plugin through the 'Plugins' menu in WordPress.<\/p>\n\n<p>Next, place <code>&lt;?php use_the_attachment_image() ?&gt;<\/code> (will include a link to the post), or <code>&lt;?php use_the_attachment_image_nolink() ?&gt;<\/code> (will NOT include a link to the post) in your template to include a thumbnail of the first attachment image. Note the function must be inside of a WordPress loop.<\/p>\n\n<p>By default, this function will include a thumbnail image. To include images of different sizes, use the respective functions below. You may also use <code>&lt;?php use_the_attachment_image_nolink() ?&gt;<\/code> in place of <code>&lt;?php use_the_attachment_image() ?&gt;<\/code> here.<\/p>\n\n<p><strong>Thumbnail<\/strong> <code>&lt;?php use_the_attachment_image('thumbnail'); ?&gt;<\/code><br \/>\n<strong>Medium<\/strong> <code>&lt;?php use_the_attachment_image('medium'); ?&gt;&lt;\/p&gt;<\/code><br \/>\n<strong>Large<\/strong> <code>&lt;?php use_the_attachment_image('large'); ?&gt;&lt;\/p&gt;<\/code><br \/>\n<strong>Full<\/strong> <code>&lt;?php use_the_attachment_image('full'); ?&gt;<\/code><br \/>\n<strong>20 px<\/strong> <code>&lt;?php use_the_attachment_image(array(20,20)); ?&gt;<\/code><br \/>\nFeel free to replace 20px with another specific size to best meet your needs. Note that WordPress will scale a larger image down to give you the size you desire here.<\/p>\n\n<p>It is possible to include a thumbnail image from each post in your RSS feed. To do this, simply add this code to your theme's functions.php file. From <a href=\"http:\/\/cdharrison.com\/2009\/12\/16\/the_post_thumbnail-for-rss-feeds\/\">cd harrison<\/a>.<\/p>\n\n<pre><code>&lt;?php\nif (function_exists('use_the_attachment_image')) {\n    function insertAttachmentRSS($content) {\n        global $post;\n        { $content = use_the_attachment_image() . $content; }\n        return $content;\n    }\n    add_filter('the_excerpt_rss', 'insertAttachmentRSS');\n    add_filter('the_content_feed', 'insertAttachmentRSS');\n}\n?&gt;\n<\/code><\/pre>\n\n<p>See <a href=\"https:\/\/tomlany.net\/attachment-image-test\/\">an example of how this plugin can be used<\/a>.<\/p>\n\n<!--section=changelog-->\n<h4>1.02<\/h4>\n\n<ul>\n<li>The code that includes the post image in an RSS feed was taken out of the plugin and moved to the readme file; as it did not previously work when it was included in a separate file from the plugin file as was suggested in the plugin instructions.<\/li>\n<\/ul>\n\n<h4>1.01<\/h4>\n\n<ul>\n<li>Fixed the function name in the documentation. In a few cases, a function that did not exist was referenced. Thanks, <a href=\"http:\/\/www.taringacs.net\/\">Matias<\/a> for the report. The actual plugin was not changed.<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Allows the first attachment image associated with a post to be used in different locations throughout a blog.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/8053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=8053"}],"author":[{"embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/tomthewebmaster"}],"wp:attachment":[{"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=8053"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=8053"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=8053"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=8053"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=8053"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/ur.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=8053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}