<?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>Bytearray - Programming, Computers and Technology &#187; Wordpress</title>
	<atom:link href="http://bytearray.brixtonjunkies.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://bytearray.brixtonjunkies.com</link>
	<description></description>
	<lastBuildDate>Tue, 03 Nov 2009 11:52:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WordPress: Custom Post Order</title>
		<link>http://bytearray.brixtonjunkies.com/2009/09/25/wordpress-custom-post-order/</link>
		<comments>http://bytearray.brixtonjunkies.com/2009/09/25/wordpress-custom-post-order/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 10:08:10 +0000</pubDate>
		<dc:creator>alchemist</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[query_posts]]></category>

		<guid isPermaLink="false">http://bytearray.brixtonjunkies.com/?p=484</guid>
		<description><![CDATA[I recently had a requirement for custom ordering on WordPress categories and thought that I would share how I did it. All that is needed is this piece of code which essentially modifies the SQL statement being generated. Note that the argument assigned to orderby is the column name, hence it is case sensitive (I [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had a requirement for custom ordering on WordPress categories and thought that I would share how I did it.</p>
<p>All that is needed is this piece of code which essentially modifies the SQL statement being generated. Note that the argument assigned to <strong>orderby</strong> is the column name, hence it is case sensitive <em>(I found out that ID breaks the naming conversion on the post table)</em>;</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
   if (is_category(array($myCatId))){
      query_posts($query_string . &quot;&amp;orderby=ID&amp;order=DESC&quot;);
   }
?&gt;
</pre>
<p><em>Code needs to be placed before this line</em></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if (have_posts()) : while (have_posts()) : the_post(); update_post_caches($posts); ?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://bytearray.brixtonjunkies.com/2009/09/25/wordpress-custom-post-order/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Adsense &#8211; Ad Targeting Redirect</title>
		<link>http://bytearray.brixtonjunkies.com/2009/08/20/wordpress-adsense-ad-targeting-redirect/</link>
		<comments>http://bytearray.brixtonjunkies.com/2009/08/20/wordpress-adsense-ad-targeting-redirect/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 16:16:47 +0000</pubDate>
		<dc:creator>alchemist</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[ad targeting]]></category>
		<category><![CDATA[adsense]]></category>
		<category><![CDATA[header redirect]]></category>
		<category><![CDATA[permalink]]></category>

		<guid isPermaLink="false">http://bytearray.brixtonjunkies.com/?p=60</guid>
		<description><![CDATA[When I was a Adsense n00b I made the mistake of adding adding a witty statement in my tagline in wordpress which confused adsense in terms of the content of my site, despite all the search engine optimization I had done . The symptom was: only the main index of my site had ads targeted [...]]]></description>
			<content:encoded><![CDATA[<p>When I was a Adsense n00b I made the mistake of adding adding a witty statement in my tagline in wordpress which confused adsense in terms of the content of my site, despite all the search engine optimization I had done . The symptom was: <span style="text-decoration: underline;">only</span> the main index of my site had ads targeted solely on the wordpress &#8220;tagline&#8221; <em>(the strip of text under the main title)</em>,  all other pages on my site were targeted correctly. I thought this would be a matter of simply changing the tagline&#8230;but no, google doesn&#8217;t forget! I wont go into detail about the type of ads that were being targeted, lets just say they weren&#8217;t ideal.</p>
<p>A simple effective work around is a header redirect <em>(permalink friendly)</em> on the main site index which can be prefixed to the wordpress index.php in your wordpress top level directory. </p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

// set $redirectHome = false to disable the redirect

$redirectHome = true;
if ($redirectHome){
        // Redirects index page
        $uriStr = $_SERVER['REQUEST_URI'];
        if (($uriStr == '/') || ($uriStr == '')){
                header('Location: /?index',true,301);
                die();
        }
        // Makes sure pages off the main index are not renamed
        $matchAry = array();
        if (preg_match('/(\/page\/\d+\/)\?index/',$uriStr,$matchAry)){
                header('Location: ' . $matchAry[1],true,301);
                die();
        }
}

/**
 * Original WordPress index.php goes here
 */
</pre>
<p>This works because Google thinks &#8220;/?index&#8221; is a new page <em>(it&#8217;s not though, it&#8217;s the main index with a query string attached)</em> and the media bot crawls it and targets it accordingly as a new page. And as long as you&#8217;ve made your amendments to your previously incorrect content, in my case the &#8220;tagline&#8221; then this time around your ads should be accurately targeted&#8230;hopefully <img src='http://bytearray.brixtonjunkies.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The curious thing is, it seems no matter what only my original main index is targeted incorrectly still months later. I&#8217;ve seen other posts relating to incorrect ad targeting on the main index only. It seems like Google&#8217;s media crawler doesn&#8217;t like something about WordPress, I would like to hear from others that have experienced this.</p>
]]></content:encoded>
			<wfw:commentRss>http://bytearray.brixtonjunkies.com/2009/08/20/wordpress-adsense-ad-targeting-redirect/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

