<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>WordPress &#8250; Support Topic: PHP if does not work</title>
<link>http://wordpress.org/support/</link>
<description>WordPress &#8250; Support Topic: PHP if does not work</description>
<language>en</language>
<pubDate>Tue, 24 Nov 2009 12:13:12 +0000</pubDate>

<item>
<title>laviolette99 on "PHP if does not work"</title>
<link>http://wordpress.org/support/topic/264292#post-1053248</link>
<pubDate>Wed, 22 Apr 2009 17:19:29 +0000</pubDate>
<dc:creator>laviolette99</dc:creator>
<guid isPermaLink="false">1053248@http://wordpress.org/support/</guid>
<description>&#60;p&#62;It works marvelously!&#60;/p&#62;
&#60;p&#62;Thanks to both of you guys!
&#60;/p&#62;</description>
</item>
<item>
<title>t31os on "PHP if does not work"</title>
<link>http://wordpress.org/support/topic/264292#post-1053127</link>
<pubDate>Wed, 22 Apr 2009 15:26:22 +0000</pubDate>
<dc:creator>t31os</dc:creator>
<guid isPermaLink="false">1053127@http://wordpress.org/support/</guid>
<description>&#60;p&#62;That's right, either switch out of PHP using &#60;code&#62;?&#38;gt;&#60;/code&#62; and &#60;code&#62;&#38;lt;?php&#60;/code&#62; or use echo/print, or whatever else...&#60;/p&#62;
&#60;p&#62;You code is being parsed as PHP, when you're wanting to output into HTML, so you need to either switch out, as per the example above or use echo/print, etc...
&#60;/p&#62;</description>
</item>
<item>
<title>iridiax on "PHP if does not work"</title>
<link>http://wordpress.org/support/topic/264292#post-1053122</link>
<pubDate>Wed, 22 Apr 2009 15:21:27 +0000</pubDate>
<dc:creator>iridiax</dc:creator>
<guid isPermaLink="false">1053122@http://wordpress.org/support/</guid>
<description>&#60;blockquote&#62;&#60;p&#62;How can I insert a script in a if statement?&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;Try this format:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php $atr=get_the_author_ID(); ?&#38;gt;

&#38;lt;?php if ($atr==6) { ?&#38;gt;
&#38;lt;!-- code here --&#38;gt;

&#38;lt;?php } elseif ($atr==4) { ?&#38;gt;
&#38;lt;!-- code here --&#38;gt;

&#38;lt;?php } else { ?&#38;gt;
&#38;lt;!-- code here --&#38;gt;

&#38;lt;?php } ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>laviolette99 on "PHP if does not work"</title>
<link>http://wordpress.org/support/topic/264292#post-1053088</link>
<pubDate>Wed, 22 Apr 2009 14:44:07 +0000</pubDate>
<dc:creator>laviolette99</dc:creator>
<guid isPermaLink="false">1053088@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I'm trying to implement a if statement to execute a script based on the author's id and it does not work. The PHP engine says that there's an unxepected &#38;lt; (the one that starts the script). &#60;/p&#62;
&#60;p&#62;Here's the code:&#60;/p&#62;
&#60;p&#62;&#38;lt;?php&#60;br /&#62;
$atr=get_the_author_ID();&#60;br /&#62;
if ($atr==6)&#60;br /&#62;
{&#60;br /&#62;
&#38;lt;script type=&#34;text/javascript&#34;&#38;gt;&#60;br /&#62;
var gaJsHost = ((&#34;https:&#34; == document.location.protocol) ? &#34;https://ssl.&#34; : &#34;http://www.&#34;);&#60;br /&#62;
document.write(unescape(&#34;%3Cscript src='&#34; + gaJsHost + &#34;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&#34;));&#60;br /&#62;
&#38;lt;/script&#38;gt;&#60;br /&#62;
&#38;lt;script type=&#34;text/javascript&#34;&#38;gt;&#60;br /&#62;
var pageTracker = _gat._getTracker(&#34;UA-697623-9&#34;);&#60;br /&#62;
pageTracker._initData();&#60;br /&#62;
pageTracker._trackPageview();&#60;br /&#62;
&#38;lt;/script&#38;gt;&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;elseif ($atr==4)&#60;br /&#62;
{&#60;br /&#62;
&#38;lt;script type=&#34;text/javascript&#34;&#38;gt;&#60;br /&#62;
var gaJsHost = ((&#34;https:&#34; == document.location.protocol) ? &#34;https://ssl.&#34; : &#34;http://www.&#34;);&#60;br /&#62;
document.write(unescape(&#34;%3Cscript src='&#34; + gaJsHost + &#34;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&#34;));&#60;br /&#62;
&#38;lt;/script&#38;gt;&#60;br /&#62;
&#38;lt;script type=&#34;text/javascript&#34;&#38;gt;&#60;br /&#62;
var pageTracker = _gat._getTracker(&#34;UA-697623-19&#34;);&#60;br /&#62;
pageTracker._initData();&#60;br /&#62;
pageTracker._trackPageview();&#60;br /&#62;
&#38;lt;/script&#38;gt;&#60;/p&#62;
&#60;p&#62;}&#60;br /&#62;
?&#38;gt; &#60;/p&#62;
&#60;p&#62;How can I insert a script in a if statement?&#60;/p&#62;
&#60;p&#62;Thanks,
&#60;/p&#62;</description>
</item>

</channel>
</rss>
