<?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; if</title>
	<atom:link href="http://wpfunc.com/tag/if/feed" rel="self" type="application/rss+xml" />
	<link>http://wpfunc.com</link>
	<description>Awesome, Quick, Simple WordPress Functions!</description>
	<lastBuildDate>Sun, 06 May 2012 02:21:37 +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>Show your categories in two Columns!</title>
		<link>http://wpfunc.com/wordpress/show-your-categories-in-two-columns.html</link>
		<comments>http://wpfunc.com/wordpress/show-your-categories-in-two-columns.html#comments</comments>
		<pubDate>Mon, 28 Sep 2009 17:47:09 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[categories in two columns]]></category>
		<category><![CDATA[else]]></category>
		<category><![CDATA[elseif]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[sidebar.php]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=228</guid>
		<description><![CDATA[I said about if and else with two or more single.php article. Also you can use this simple functions on your categories. You can show your categories in two columns. This a simple code and you can apply it only copy/paste :) Here is the code; We use wp_list_categories(); function when we calling our categories. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I said about if and else with <a href="http://www.wpfunc.com/wordpress/use-two-or-more-single-php.html" target="_blank">two or more single.php</a> article. Also you can use this simple functions on your categories. You can show your categories in two columns. This a simple code and you can apply it only copy/paste :)<span id="more-228"></span></p>
<h3>Here is the code;</h3>
<p style="text-align: justify;">We use <em><strong>wp_list_categories</strong><strong>();</strong></em> function when we calling our categories. But if we change this function we can change our category listing. Just copy and paste this function in your <span style="color: #ff0000;"><em><strong>sidebar.php</strong></em></span> file and show your categories in two columns.</p>
<pre class="brush: plain; title: ; notranslate">&lt;?php
$cats = explode(&quot;&lt;br /&gt;&quot;,wp_list_categories('title_li=&amp;echo=0&amp;depth=1&amp;style=none'));
$cat_n = count($cats) - 1;
for ($i=0;$i&lt;$cat_n;$i++):
if ($i&lt;$cat_n/2):
$cat_left = $cat_left.'&lt;li&gt;'.$cats[$i].'&lt;/li&gt;';
elseif ($i&gt;=$cat_n/2):
$cat_right = $cat_right.'&lt;li&gt;'.$cats[$i].'&lt;/li&gt;';
endif;
endfor;
?&gt;
&lt;ul class=&quot;left&quot;&gt;
&lt;?php echo $cat_left;?&gt;
&lt;/ul&gt;
&lt;ul class=&quot;right&quot;&gt;
&lt;?php echo $cat_right;?&gt;
&lt;/ul&gt;</pre>
<p style="text-align: justify;">After that we have to change our <em><strong>style.css</strong></em> for <em><strong><span style="color: #ff0000;">left</span></strong></em> and<em><strong><span style="color: #ff0000;"> right</span></strong></em> terms. her is the code;</p>
<pre class="brush: css; title: ; notranslate">.right {float:left; width:140px;}
.left {float:left; width:140px;}</pre>
<p style="text-align: justify;">That&#8217;s All. Have a nice day!</p>
<p style="text-align: justify;">The Original Post: <em><strong><a href="http://www.blogohblog.com/10-wordpress-hacks-to-make-your-life-even-easier/" target="_blank">Blog-Oh-Blog</a></strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://wpfunc.com/wordpress/show-your-categories-in-two-columns.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Some Plugins can break your blog, but you can change it!</title>
		<link>http://wpfunc.com/wordpress/some-plugins-can-break-your-blog-but-you-can-change-it.html</link>
		<comments>http://wpfunc.com/wordpress/some-plugins-can-break-your-blog-but-you-can-change-it.html#comments</comments>
		<pubDate>Tue, 22 Sep 2009 00:46:00 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[function_exists]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[system]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=194</guid>
		<description><![CDATA[Some plugins break your blog when you deactivate! This reason some plugins don&#8217;t have an &#8216;if&#8217; function with this short codes. This can break your blog. You can change it very simple. We will use if and function_exists tags when we call the plugin ord function. With this simple tags help us to work clean. I [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Some plugins break your blog when you deactivate! This reason some plugins don&#8217;t have an &#8216;if&#8217; function with this short codes. This can break your blog. You can change it very simple. We will use<strong> <span style="color: #ff0000;">if</span></strong> and <span style="color: #ff0000;"><strong>function_exists</strong></span> tags when we call the plugin ord function. With this simple tags help us to work clean.<span id="more-194"></span></p>
<p style="text-align: justify;">I will give to you a simple trick. I will use a example for explain that. Look at this code below. I Will use Related Post Plugin&#8217;s code.</p>
<p>Example:</p>
<pre class="brush: plain; title: ; notranslate">&lt;?php related_posts(); ?&gt;</pre>
<p>With <strong>if</strong> and <strong>function_exists</strong>:</p>
<pre class="brush: plain; title: ; notranslate">&lt;?php if(function_exists('related_posts')) { related_posts(); } ?&gt;</pre>
<p style="text-align: justify;">We use <strong>related_posts</strong> twice. But with this code the plugin don&#8217;t make any problems after deactivating. You can apply this code all plugins  which one have a short code like Related Post Plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfunc.com/wordpress/some-plugins-can-break-your-blog-but-you-can-change-it.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Hide Your Single Post From Search Engines</title>
		<link>http://wpfunc.com/wordpress/how-to-hide-your-single-post-from-search-engines.html</link>
		<comments>http://wpfunc.com/wordpress/how-to-hide-your-single-post-from-search-engines.html#comments</comments>
		<pubDate>Sat, 18 Jul 2009 01:26:10 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[hide]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[no-index]]></category>
		<category><![CDATA[noindex]]></category>
		<category><![CDATA[posts]]></category>
		<category><![CDATA[Yahoo]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=60</guid>
		<description><![CDATA[Have you ever a semi-private post? If your answer is &#8216;yes&#8216; you can hide your post from search engines. How? Very Simple. It&#8217;s only 3 line code. With this code you will add a noindex tag to your post. Firstly you have to know your post ID. It&#8217;s important for this code. If you already [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Have you ever a semi-private post? If your answer is &#8216;<strong>yes</strong>&#8216; you can hide your post from search engines. How? Very Simple. It&#8217;s only 3 line code. With this code you will add a noindex tag to your post. Firstly you have to know your post <strong><span style="color: #ff0000;">ID</span></strong>. It&#8217;s important for this code. If you already know, lets begin&#8230;<span id="more-60"></span></p>
<p style="text-align: justify;">Open your <em><strong><span style="color: #ff0000;">header.php</span></strong></em> and add this code between <strong>&lt;head&gt;</strong> and <strong>&lt;/head&gt;</strong> tags.</p>
<pre class="brush: plain; title: ; notranslate"> &lt;?php if ($post-&gt;ID == xx) {
    echo '&lt;meta name=&quot;robots&quot; content=&quot;noindex&quot;&gt;';
} ?&gt;</pre>
<p>Change xx with your post&#8217;s ID.</p>
<p>That&#8217;s All. Have a nice day!</p>
<p><span style="color: #ffffff;">For Technorati:2iu6n4qx9s</span></p>
]]></content:encoded>
			<wfw:commentRss>http://wpfunc.com/wordpress/how-to-hide-your-single-post-from-search-engines.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Add Author Name to Author Archive</title>
		<link>http://wpfunc.com/wordpress/how-to-add-author-name-to-author-archive.html</link>
		<comments>http://wpfunc.com/wordpress/how-to-add-author-name-to-author-archive.html#comments</comments>
		<pubDate>Fri, 17 Jul 2009 17:00:47 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[author]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[else]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=41</guid>
		<description><![CDATA[Hi everybody. Yes we will add author name to archive, admin/editor/publisher archive pages show their name like &#8220;Author archive for (author name)&#8221;. Lets begin&#8230; First, open your archive.php from your theme folder. This is a sample code, it can be different in your theme. Find And replace with; After you apply this code the author [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Hi everybody. Yes we will add author name to archive, admin/editor/publisher archive pages show their name like &#8220;Author archive for (author name)&#8221;. Lets begin&#8230;<span id="more-41"></span></p>
<p style="text-align: justify;">First, open your <span style="color: #ff0000;"><strong><em>archive.php</em></strong></span> from your theme folder. This is a sample code, it can be different in your theme.</p>
<h3>Find</h3>
<pre class="brush: plain; title: ; notranslate">&lt; ?php /* If this is an author archive */ } elseif (is_author()) { ?&gt;
&lt;h2&gt;Author Archive for&lt;/h2&gt;</pre>
<h3>And replace with;</h3>
<pre class="brush: plain; title: ; notranslate">&lt; ?php /* If this is an author archive */ } elseif (is_author()) { ?&gt;
&lt; ?php $author = get_userdata( get_query_var('author') );?&gt;
&lt;h2&gt;Author Archive for &lt; ?php echo $author-&gt;display_name;?&gt;&lt;/h2&gt;</pre>
<p style="text-align: justify;">After you apply this code the author archive page title will change like &#8220;<strong>Archive for (author name)</strong>&#8220;.</p>
<p style="text-align: justify;">That code different in my theme. If you click my avatar in the bottom of this post, you call my author archive page and again you can see author name in the bottom of  page.</p>
<p>That&#8217;s All! Have a nice day!</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfunc.com/wordpress/how-to-add-author-name-to-author-archive.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Use Two or More Single.php</title>
		<link>http://wpfunc.com/wordpress/use-two-or-more-single-php.html</link>
		<comments>http://wpfunc.com/wordpress/use-two-or-more-single-php.html#comments</comments>
		<pubDate>Thu, 16 Jul 2009 23:32:55 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[core file]]></category>
		<category><![CDATA[else]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[single.php]]></category>
		<category><![CDATA[vectorss]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=19</guid>
		<description><![CDATA[In WordPress, we can use only one single.php. But sometimes we need different single pages for different categories. Also my friend Hakan needs 2 different single.php for his site. We build a blog page for his Vectorss site but we had a problem with ads and published pictures. We have to change this single pages. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">In WordPress, we can use only one single.php. But sometimes we need different single pages for different categories. Also my friend Hakan needs 2 different single.php for his site. We build a blog page for his <a href="http://www.vectorss.com" target="_blank">Vectorss</a> site but we had a problem with ads and published pictures. We have to change this single pages. After this problem, i was search and found a litte information about this problem. In this information there is a sentence like this &#8220;<em>You can solve this problem with if and else</em>&#8220;. I think about this  and i write some function. It&#8217;s Worked!<span id="more-19"></span><span class="attention"><strong>With this function/recipe you will change your core single.php file. If you have no information about WordPress coding -so you&#8217;re a newbie- you can get some support if you send a mail to me. Don&#8217;t touch your single.php if you don&#8217;t know about WordPress</strong></span></p>
<h3 style="text-align: justify;">Yep, lets start!</h3>
<p style="text-align: justify;">We cnahge our core single.php also you have to make a back-up this file. And you have to make 2 copy of this core file,  and <em><strong>single-blog.php</strong><strong>single-default.php</strong></em> (<em>single-default is a copy of our core file</em>). And upload these 2 files to your host (in template folder). After that, open your single.php on your server (with a ftp program ex: CuteFtp) and clean all code in this file and add this codes to single.php ;</p>
<pre class="brush: plain; title: ; notranslate">
&lt;?php
$post = $wp_query-&gt;post;
if ( in_category('3') ) {
 include(TEMPLATEPATH . '/single-blog.php'); }
 else { include(TEMPLATEPATH . '/single-default.php');
}
?&gt;</pre>
<p style="text-align: justify;">We make a duplicate with this code. But we give a special command to this code. With If, we said to code &#8220;<em>if we click a post in category 3 you have to call single-blog.php to us</em>&#8220;. If we get a normal category post, our core single.php call single-default.php to us. After this code our core single.php will be a tunnel page for us.</p>
<p style="text-align: justify;">And if you wanna make more single pages for your different categories you can duplicate this code.</p>
<h3>Here is the second code:</h3>
<pre class="brush: plain; title: ; notranslate">&lt;?php
$post = $wp_query-&gt;post;
if ( in_category('3') ) {
include(TEMPLATEPATH . '/single-blog.php'); }
elseif ( in_category('15') ) {
include(TEMPLATEPATH . '/single-foto.php'); }
elseif ( in_category('18') ) {
include(TEMPLATEPATH . '/single-video.php'); }
else { include(TEMPLATEPATH . '/single-default.php');
}
?&gt;</pre>
<p>Have a nice day!</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfunc.com/wordpress/use-two-or-more-single-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

