<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WpFunc &#187; image</title>
	<atom:link href="http://wpfunc.com/tag/image/feed" rel="self" type="application/rss+xml" />
	<link>http://wpfunc.com</link>
	<description>Awesome, Quick, Simple WordPress Functions!</description>
	<lastBuildDate>Thu, 01 Dec 2011 01:17:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Catch the First Image (Upgraded)</title>
		<link>http://wpfunc.com/wordpress/catch-the-first-image-upgraded.html</link>
		<comments>http://wpfunc.com/wordpress/catch-the-first-image-upgraded.html#comments</comments>
		<pubDate>Sat, 12 Nov 2011 00:42:34 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[catch the first image]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[custom field]]></category>
		<category><![CDATA[first image]]></category>
		<category><![CDATA[full]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[index.php]]></category>
		<category><![CDATA[latest]]></category>
		<category><![CDATA[single.php]]></category>
		<category><![CDATA[thumb]]></category>
		<category><![CDATA[thumbnail]]></category>
		<category><![CDATA[timthumb]]></category>
		<category><![CDATA[upgraded]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=509</guid>
		<description><![CDATA[Brian asked me here about Catch the First image function can be upgrade. I was coded this function for my Turkish blog for Home Page thumbs. If you set no image about post (not the wordpress post thumb feature, if you dont upload any image) this function get custom (default) image for this. Let&#8217;s Begin&#8230;
The [...]]]></description>
			<content:encoded><![CDATA[<p>Brian asked me <a href="http://www.wpfunc.com/wordpress/catch-the-first-image.html/comment-page-1#comment-949" target="_blank">here</a> about <a href="http://www.wpfunc.com/wordpress/catch-the-first-image.html" title="Catch the First Image" target="_blank">Catch the First image function</a> can be upgrade. I was coded this function for my Turkish blog for Home Page thumbs. If you set no image about post (not the wordpress post thumb feature, if you dont upload any image) this function get custom (default) image for this. Let&#8217;s Begin&#8230;<span id="more-509"></span></p>
<h4>The Code;</h4>
<p>You will edit your theme&#8217;s <strong>functions.php</strong>. Because of this you should <strong>backup</strong> before. File&#8217;s path is <strong>/wp-content/themes/your-theme/functions.php</strong></p>
<pre class="brush: php; title: ; notranslate">// Get Image Attachments
function sa_get_image($postid=0, $size='thumbnail') { //it can be thumbnail or full
	if ($postid&lt;1)
	$postid = get_the_ID();
	$thumb = get_post_meta($postid, &quot;thumb&quot;, TRUE); // Declare the custom field for the image
	if ($thumb != null or $thumb != '') {
		echo $thumb;
	}
	elseif ($images = get_children(array( //If you upload an image function gets first image
		'post_parent' =&gt; $postid,
		'post_type' =&gt; 'attachment',
		'numberposts' =&gt; '1',
		'post_mime_type' =&gt; 'image', )))
		foreach($images as $image) {
			$thumbnail=wp_get_attachment_image_src($image-&gt;ID, $size);
			?&gt;
	&lt;?php echo $thumbnail[0]; ?&gt;
	&lt;?php }
		else { //If you don't upload or declare as thumb custom field func. gets custom (default) image
		echo get_bloginfo ( 'template_directory' ); //same as wp-content/themes/your-theme/
		echo '/images/image-pending.gif'; // Put this image into your themes images folder and set the path here
	}
}</pre>
<p>You can use this function with your several files like index.php, single.php or anything. </p>
<pre class="brush: php; title: ; notranslate">&lt;img src=&quot;&lt;?php sa_get_image($post-&gt;ID, 'thumbnail'); ?&gt;&quot; /&gt;</pre>
<p>If you set your thumbnail size 100*100 from wordpress you can get a thumbnail image where you want. Also you can use another function with that. You can style your image&#8217;s div or you can use timthumb.</p>
<h4>Without Timthumb;</h4>
<pre class="brush: php; title: ; notranslate">// Show Post Thumbnails
function sa_show_thumb_tim() {
?&gt;
&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot;&gt;&lt;img class=&quot;thumb&quot; width=&quot;100&quot; height&quot;100&quot; src=&quot;&lt;?php sa_get_image($post-&gt;ID, 'full'); ?&gt;&quot; alt=&quot;&lt;?php the_title(); ?&gt;&quot; /&gt;&lt;/a&gt;
&lt;?php
}</pre>
<p>You can use this like this directly. Because we coded function with <code>img</code> tag.</p>
<pre class="brush: php; title: ; notranslate">&lt;?php sa_show_thumb(); ?&gt;</pre>
<h4>With Timthumb;</h4>
<pre class="brush: php; title: ; notranslate">// Show Post Thumbnails With TimThumb
function sa_show_thumb_tim() {
?&gt;
&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot;&gt;&lt;img class=&quot;thumb&quot; src=&quot;&lt;?php bloginfo('template_directory'); ?&gt;/timthumb.php?src=&lt;?php sa_get_image($post-&gt;ID, 'full'); ?&gt;&amp;amp;h=100&amp;amp;w=100&amp;amp;zc=1&quot; alt=&quot;&lt;?php the_title(); ?&gt;&quot; /&gt;&lt;/a&gt;
&lt;?php
}</pre>
<p>You can use this like this directly. Because we coded function with <code>img</code> tag and we add timthumb function. You can get the latest version of timhtumb <a href="http://code.google.com/p/timthumb/" target="_blank">here</a>. And you have to put <strong>timthumb.php</strong> into your theme&#8217;s folder.</p>
<pre class="brush: php; title: ; notranslate">&lt;?php sa_show_thumb_tim(); ?&gt;</pre>
<p>Best Regards</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfunc.com/wordpress/catch-the-first-image-upgraded.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You can stop Hotlinking!</title>
		<link>http://wpfunc.com/wordpress/you-can-stop-hotlinking.html</link>
		<comments>http://wpfunc.com/wordpress/you-can-stop-hotlinking.html#comments</comments>
		<pubDate>Mon, 21 Sep 2009 16:41:58 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[bandwith]]></category>
		<category><![CDATA[hidden file]]></category>
		<category><![CDATA[hotlinking]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[steal]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=181</guid>
		<description><![CDATA[Yeah! Hotlinking is bad! I don&#8217;t use any image for that! If you use a lot of or nice photograps/ images the hotlinkers :) or bandwith thiefs can use your images and you can show this people like stupid :)
If you want to do this only you have to change .htaccess file. Just copy this [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Yeah! Hotlinking is bad! I don&#8217;t use any image for that! If you use a lot of or nice photograps/ images the hotlinkers :) or bandwith thiefs can use your images and you can show this people like stupid :)<span id="more-181"></span></p>
<p style="text-align: justify;">If you want to do this only you have to change <strong><span style="color: #ff0000;">.htaccess</span></strong> file. Just copy this code below and change image path. After that if somebody<strong> steal</strong> your image/photo the code change this photos with your image. Thief shown like a stupid.</p>
<h3>Here is the code;</h3>
<pre class="brush: plain; title: ; notranslate">#disable hotlinking of images with forbidden or custom image option
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com/.*$ [NC]
#RewriteRule \.(gif|jpg|png)$ %u2013 [F]
#RewriteRule \.(gif|jpg|png)$ http://www.yourdomain.com/stealingisbad.gif [R,L] </pre>
<p style="text-align: justify;">Copy this code into <strong>.htaccess</strong> file. If you can&#8217;t se this file in your FTP program you can add filter like <strong>-a</strong> and <strong>-l</strong>. After that you can see this <strong>. (dot)</strong> and <strong>hidden</strong> files.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfunc.com/wordpress/you-can-stop-hotlinking.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add No-Index to Images</title>
		<link>http://wpfunc.com/wordpress/add-no-index-to-images.html</link>
		<comments>http://wpfunc.com/wordpress/add-no-index-to-images.html#comments</comments>
		<pubDate>Fri, 17 Jul 2009 10:00:19 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[no-index]]></category>
		<category><![CDATA[robots]]></category>
		<category><![CDATA[spiders]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=33</guid>
		<description><![CDATA[When Google spiders reach to our site, google automatically index everything with our site images. If we want to make a non-indexable images, there is a simple code. We can make all our images non-indexable. We will add a code to our header.php. Also we can stop directory indexing with simple Robots.txt command.
And we begin&#8230;
No-Index [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">When Google spiders reach to our site, google automatically index everything with our site images. If we want to make a non-indexable images, there is a simple code. We can make all our images non-indexable. We will add a code to our header.php. Also we can stop directory indexing with simple Robots.txt command.<span id="more-33"></span></p>
<p>And we begin&#8230;</p>
<h3 style="text-align: justify;">No-Index for all images</h3>
<pre class="brush: plain; title: ; notranslate">&lt;meta name=&quot;robots&quot; content=&quot;noimageindex&quot;&gt;</pre>
<p style="text-align: justify;">Add this code to <strong><em>header.php</em></strong> and Google don&#8217;t resume to index your images.</p>
<p style="text-align: justify;">Also if you want to stop directory indexing. Open your <strong><em>robots.txt</em></strong>. This file located in your <em><strong>Root</strong></em> area;</p>
<p style="text-align: justify;">Ex: We have  <strong>images</strong> and <strong>siteimages</strong> folders. And we have a robots.txt like this.</p>
<pre class="brush: plain; title: ; notranslate">User-agent: *
Disallow:</pre>
<p style="text-align: justify;">We will change this to;</p>
<pre class="brush: plain; title: ; notranslate">User-agent: *
Disallow: /images/
Disallow: /siteimages/</pre>
<p>Thats All! Have a nice day!</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfunc.com/wordpress/add-no-index-to-images.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

