<?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; blog</title>
	<atom:link href="http://wpfunc.com/tag/blog/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>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 will [...]]]></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>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>

