<?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>CleverWP.com -&#62; WordPress Customization, WordPress Development and WordPress SEO &#187; WordPress Development Tips</title>
	<atom:link href="http://cleverwp.com/wordpress-development-tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://cleverwp.com</link>
	<description>Clever WordPress SEO, Tutorials, Plugins and more</description>
	<lastBuildDate>Thu, 02 Feb 2012 19:01:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>WordPress Content Deployment with RAMP</title>
		<link>http://cleverwp.com/wordpress-content-deployment-with-ramp/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-content-deployment-with-ramp</link>
		<comments>http://cleverwp.com/wordpress-content-deployment-with-ramp/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 06:09:06 +0000</pubDate>
		<dc:creator>Lars Koudal</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Development Tips]]></category>

		<guid isPermaLink="false">http://cleverwp.com/?p=1389</guid>
		<description><![CDATA[RAMP is a WordPress plugin that allows you to easily deploy changes from development servers directly to the production server.

WITHOUT the hassle of either replicating all steps manually or the more hardcore way of dumping and importing the entire database.]]></description>
			<content:encoded><![CDATA[<p><a  href="http://crowdfavorite.com/wordpress/ramp/" target="_blank">RAMP</a> is a WordPress plugin that allows you to easily deploy changes you create on staging or development servers directly to the production server WITHOUT the hassle of either replicating all steps manually, exporting and importing or even the more hardcore way of dumping and importing the database.</p>
<p>Not only can you work on your local server and deploy changes directly with one click, you can also utilize the preflight checklist to make sure the changes you are deploying are not in conflict with the development server.</p>
<p>So, if you have created a new post and during that creation also created a category and/or a few tags, RAMP will automatically create these categories and tags as well.</p>
<p>RAMP also checks if there has been any more recent changes on the production server, saving you the emberassment of overwriting newer changes with older ones.</p>
<p>This WordPress plugin looks quite amazing, and I have not even played with it yet. I would love to play around with it for an upcoming future project!</p>
<p>Now, the most important thing is the Rollback feature. Or it will be for me at least. </p>
<p>If you do any mistakes you can easily roll back to an earlier version, letting you sleep well at night.</p>
<p>The tone and dash of humour on the site is a big plus in my book as well <img src='http://cleverwp.com.s3.amazonaws.com/wp-includes/images/smilies/icon_smile.gif' alt="icon smile WordPress Content Deployment with RAMP" class='wp-smiley' title="WordPress Content Deployment with RAMP" /> </p>
<p><a  href="http://crowdfavorite.com/wordpress/ramp/" target="_blank">Go take a look</a>, and let me know in the comments what you think of it</p>
<p>The company behind is Crowd Favorite.</p>
<div class="cbw snap_nopreview">
<div class="cbw_header"><script src="http://www.crunchbase.com/javascripts/widget.js" type="text/javascript"></script>
<div class="cbw_header_text"><a  href="http://www.crunchbase.com/">CrunchBase Information</a></div>
</div>
<div class="cbw_content">
<div class="cbw_subheader"><a  href="http://www.crunchbase.com/company/crowd-favorite">Crowd Favorite</a></div>
<div class="cbw_subcontent"><script src="http://www.crunchbase.com/cbw/company/crowd-favorite.js" type="text/javascript"></script></div>
<div class="cbw_footer">Information provided by <a  href="http://www.crunchbase.com/">CrunchBase</a></div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://cleverwp.com/wordpress-content-deployment-with-ramp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Functions.php Code Collection on Stackexchange</title>
		<link>http://cleverwp.com/wordpress-functions-php-code-collection/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-functions-php-code-collection</link>
		<comments>http://cleverwp.com/wordpress-functions-php-code-collection/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 11:33:57 +0000</pubDate>
		<dc:creator>Lars Koudal</dc:creator>
				<category><![CDATA[Featured Posts]]></category>
		<category><![CDATA[WordPress Development Tips]]></category>
		<category><![CDATA[WordPress Optimization]]></category>

		<guid isPermaLink="false">http://cleverwp.com/?p=1387</guid>
		<description><![CDATA[Functions.php code collection hosted on WordPress Answers on Stackexchange.com - The best code collection for your functions.php WordPress.

The functions.php file in your WordPress theme is an underutilized resource for many WordPress powered sites.]]></description>
			<content:encoded><![CDATA[<h2>WordPress functions.php</h2>
<p>The functions.php file in your WordPress theme is an underutilized resource for many WordPress powered sites.</p>
<p>Relying on WordPress plugins only to customize your site can result in an overabundance of WordPress plugins which slows down your site.</p>
<p>Whenever possible I add pieces of code to the active WordPress theme&#8217;s functions.php file instead, and a great resource for useful snippets of code that works in functions.php is on the continously updated &#8220;<a  title="Best Collection of Code for your functions.php file" href="http://wordpress.stackexchange.com/" target="_blank">Best Collection of Code for your functions.php file</a>&#8220;.</p>
<h2>Best functions.php Code Collection</h2>
<p>The WordPress Answers site hosted on Stackexchange is a brilliant resource to interact with other WordPress developers and exchange knowledge.</p>
<p>Here are just a few of the code snippets you can find there:</p>
<ul>
<li>Remove Update Notification for all users except ADMIN User</li>
<li>Modify the Login Logo &amp; Image URL Link</li>
<li>Loading jQuery from the Google CDN</li>
<li>Remove the WordPress Version Info for Security</li>
<li>Add Spam &amp; Delete Links to Comments on Front End</li>
<li>Remove Default WordPress Meta Boxes</li>
<li>Set a maximum number of post revisions to avoid DB bloat</li>
<li>Function to change the length of Excerpt</li>
<li>Customize the Dashboard</li>
<li>&#8230;</li>
</ul>
<p>The list goes on&#8230;</p>
<p>Direct link: <a  title="Best Collection of Code for your functions.php file" href="http://wordpress.stackexchange.com/questions/1567/best-collection-of-code-for-your-functions-php-file" target="_blank">Best Collection of Code for your functions.php file</a></p>
<p><a  href="http://wordpress.stackexchange.com/users/667/lars-koudal" target="_blank">My WordPress Answers Profile page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cleverwp.com/wordpress-functions-php-code-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Portable Development with &#8220;Instant WordPress&#8221;</title>
		<link>http://cleverwp.com/portable-development-instant-wordpress/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=portable-development-instant-wordpress</link>
		<comments>http://cleverwp.com/portable-development-instant-wordpress/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 22:32:37 +0000</pubDate>
		<dc:creator>Lars Koudal</dc:creator>
				<category><![CDATA[WordPress Development Tips]]></category>

		<guid isPermaLink="false">http://cleverwp.com/?p=1383</guid>
		<description><![CDATA[<p>Instant WordPress is a standalone development environment, specifically designed for WordPress.</p>
<p>It even runs from a USB drive. (Win only)</p>]]></description>
			<content:encoded><![CDATA[<p>Instant WordPress is a standalone development environment, specifically designed for WordPress.</p>
<p>The developer, Seamus Brady, used to work as a contract IT Trainer and he needed a way to quickly set up test environments.</p>
<p>The best thing is that it works from a USB drive, and is completely self contained. A great idea for setting up test environments in seconds.</p>
<p>Direct link: <a  title="Instant WordPress - WordPress Development Tool" href="http://www.instantwp.com/" target="_blank">Instant WordPress</a> (Windows only)</p>
<p class="alignright"><em>Source: <a  href="http://wpmu.org/introducing-instant-wordpress-a-free-portable-development-environment/" target="_blank">wpmu.org</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://cleverwp.com/portable-development-instant-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP E-Commerce Tip: Download Purchases</title>
		<link>http://cleverwp.com/wp-e-commerce-tip-download-purchases/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wp-e-commerce-tip-download-purchases</link>
		<comments>http://cleverwp.com/wp-e-commerce-tip-download-purchases/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 09:34:44 +0000</pubDate>
		<dc:creator>Lars Koudal</dc:creator>
				<category><![CDATA[Featured Posts]]></category>
		<category><![CDATA[WordPress Development Tips]]></category>

		<guid isPermaLink="false">http://cleverwp.com/?p=1340</guid>
		<description><![CDATA[Learn how to show download links for your customers using WP E-Commerce.]]></description>
			<content:encoded><![CDATA[<div class='et-box et-shadow'>
					<div class='et-box-content'><h2>What is &#8220;WP E-Commerce&#8221;?</h2>
<p><strong><a  href="http://www.instinct.co.nz/e-commerce/" target="_blank">WP E-Commerce</a> is a well known WordPress web shop plugin, and is used by millions.</strong></p>
<p>Although stable and very flexible, WP E-Commerce can be hard to tweak, and there is currently no method for allowing returning customers to re-download their purchases from a page on your site.</p>
<p>I will show you how to do this in this blogpost.</p></div></div>
<p>I have been working the last few days on moving from an old shop plugin to the well known WP E-Commerce WordPress plugin to handle <a  href="http://cleverplugins.com/shop/" target="_blank">my store on CleverPlugins.com</a></p>
<p>I have worked a bit with WP E-Commerce before and it has been used in many of my latest customer projects as well.</p>
<p>For my customers (on CleverPlugins.com) I wanted to make a way for them to log in and download their purchases again and/or any updates should they occur.</p>
<p>I do this via a custom page template which I have then customized a bit.</p>
<p>The following piece of code checks if the visitor is logged in. If so a check is made if any purchases have been made and the code then lists the WP E-Commerce download link for each purchase.</p>
<p>By using WP E-Commerce&#8217;s internal download system, you automatically use any limitations on downloads if you use that feature.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
global $current_user;
get_currentuserinfo(); 

if ( is_user_logged_in() ) {                         

     $downloadables = $wpdb-&gt;get_results('SELECT `id` , `sessionid` FROM `'.$wpdb-&gt;prefix.&quot;wpsc_purchase_logs&quot;
.'` WHERE `user_ID` = '.$current_user-&gt;ID.' LIMIT 100');

    if(count($downloadables) &gt; 0) { //we've found previous purchases!!
         foreach ($downloadables as $downloadable){ //get data for each download and process...
              $filedata = $wpdb-&gt;get_results('SELECT `id` , `product_id` , `uniqueid` , `downloads` , `ip_number` FROM `'.$wpdb-&gt;prefix.&quot;wpsc_download_status&quot;
.'` WHERE `purchid` = &quot;'.$downloadable-&gt;id.'&quot;');

              $downloadurl=get_bloginfo('wpurl').&quot;http://cleverplugins.com/?downloadid=&quot;.$filedata[0]-&gt;uniqueid; //Generate the unique download link.
               $prodtitle = $wpdb-&gt;get_var('SELECT `post_title` FROM `cpwp_posts` WHERE `ID` = '.$filedata[0]-&gt;product_id); // Look up the title of the product

               echo &quot;&lt;h4&gt;$prodtitle&lt;/h4&gt;&lt;a href='$downloadurl' target='_blank'&gt;Click here to download&lt;/a&gt;&quot;;
         }
     }
}

else {
	// visitor is not logged in. Here you can show a notice.
}
?&gt;
</pre>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://cleverwp.com/wp-e-commerce-tip-download-purchases/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>$current_screen WordPress Global Variable</title>
		<link>http://cleverwp.com/current_screen-wordpress-global-variable/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=current_screen-wordpress-global-variable</link>
		<comments>http://cleverwp.com/current_screen-wordpress-global-variable/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 22:58:42 +0000</pubDate>
		<dc:creator>Lars Koudal</dc:creator>
				<category><![CDATA[WordPress Development Tips]]></category>

		<guid isPermaLink="false">http://cleverwp.com/?p=1238</guid>
		<description><![CDATA[$current_screen WordPress Global Variable. What it is, how to use it and a reference table with all the different values.]]></description>
			<content:encoded><![CDATA[<p>For highly customized WordPress installations is can be useful to have specific instructions in usage for specific pages. These instructions could be in the form of a FAQ, a step-by-step instruction list, a helpful flash-animation, there are several options available.</p>
<p>For specific targeting of instructions we can use  <strong>$current_screen</strong> to detect where the user is.</p>
<h2>$current_screen</h2>
<p>I stumbled into the <a  href="http://phpxref.ftwr.co.uk/wordpress/nav.html?wp-admin/includes/template.php.source.html#l2015" target="_blank">$current_screen</a> global variable by chance, looking for something else in the WordPress source code. This little documented global variable contains information about which page specifically you are currently viewing in the WordPress administration interface.</p>
<p>Using this variable you can either embed the necessary code in a plugin, or as I prefer, modify the WordPress theme&#8217;s functions.php file.</p>
<h2>Example Code</h2>
<pre class="brush: php; title: ; notranslate">
&lt;?php

add_action('admin_notices', 'notifications');

// -----------------------------------------------------------------------------------------------------------
		/**
		*
		* notifications() - Administration Header Instructions and Notifications
		*
		*/
function notifications() {
global $current_screen;

if ($current_screen-&gt;id=='dashboard') ) {
			echo &quot;&lt;div id='notice_dashboard' class='updated fade'&gt;&lt;p&gt;Welcome to your blog!&lt;/p&gt;&lt;/div&gt;&quot;;
}
}
?&gt;
</pre>
<div id="attachment_1267" class="wp-caption alignleft" style="width: 160px"><a  href="http://cleverwp.com.s3.amazonaws.com/wp-content/uploads/by-default-2010-09-30-at-00.33.47.jpg" class="thickbox no_icon" rel="gallery-1238" title="Welcome To Your Blog"><img class="size-thumbnail wp-image-1267 " title="Welcome To Your Blog" src="http://cleverwp.com.s3.amazonaws.com/wp-content/uploads/by-default-2010-09-30-at-00.33.47-150x100.jpg" alt="by default 2010 09 30 at 00.33.47 150x100 $current screen WordPress Global Variable" width="150" height="100" /></a><p class="wp-caption-text">&quot;Welcome to your blog!&quot;</p></div>
<p>The code above shows a simple &#8220;Welcome to your blog!&#8221; if you are on the dashboard page. You can target other specific pages by changing the look-up on $current_screen-&gt;id to another value. You can use the reference table I created below.</p>
<p>Notice that I have added a unique css id identifier to the the &lt;div&gt;-tag. By doing this it I am able to style pages individually if I need to.</p>
<p>Another example usage could be to remind authors to make sure they have chosen a category and tagged posts before they publish.</p>
<pre class="brush: php; title: ; notranslate">

if ($current_screen-&gt;id=='post') ) {
			echo &quot;&lt;div id='notice_post' class='updated fade'&gt;&lt;p&gt;Please remember to choose both a CATEGORY and to TAG the post before you publish!&lt;/p&gt;&lt;/div&gt;&quot;;
}
</pre>
<h2>Reference Table</h2>
<p>I created the following reference table to help other developers who want to create super targeted instructions in their WordPress installations.</p>
<table id="one-column-emphasis">
<thead>
<tr>
<th id="url" scope="col">Main Menu</th>
<th id="mtb" scope="col">Submenu</th>
<th id="sbp" scope="col"><strong>$current_screen-&gt;id</strong></th>
</tr>
</thead>
<tfoot>
<tr>
<td></td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Super Admin</td>
<td></td>
<td>ms-admin</td>
</tr>
<tr>
<td></td>
<td>Sites</td>
<td>ms-sites</td>
</tr>
<tr>
<td></td>
<td>Users</td>
<td>ms-users</td>
</tr>
<tr>
<td></td>
<td>Themes</td>
<td>ms-themes</td>
</tr>
<tr>
<td></td>
<td>Options</td>
<td>ms-options</td>
</tr>
<tr>
<td></td>
<td>Update</td>
<td>ms-upgrade-network</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Dashbord</td>
<td></td>
<td>dashboard</td>
</tr>
<tr>
<td></td>
<td>My Sites</td>
<td>my-sites</td>
</tr>
<tr>
<td></td>
<td>Updates</td>
<td>update-core</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Posts</td>
<td></td>
<td>edit-post</td>
</tr>
<tr>
<td></td>
<td>Add New</td>
<td>post</td>
</tr>
<tr>
<td></td>
<td>Categories</td>
<td>edit-category</td>
</tr>
<tr>
<td></td>
<td>Post Tags</td>
<td>edit-post_tag</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Media</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>Library</td>
<td>upload</td>
</tr>
<tr>
<td></td>
<td>Add New</td>
<td>media</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Links</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>Links</td>
<td>link-manager</td>
</tr>
<tr>
<td></td>
<td>Add New</td>
<td>link</td>
</tr>
<tr>
<td></td>
<td>Link Categories</td>
<td>edit-link-categories</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Pages</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>Pages</td>
<td>edit-page</td>
</tr>
<tr>
<td></td>
<td>Add New</td>
<td>page</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><strong>Comments</strong></td>
<td></td>
<td>edit-comments</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Appearance</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>Themes (Manage)</td>
<td>themes</td>
</tr>
<tr>
<td></td>
<td>Themes (install)</td>
<td>theme-install</td>
</tr>
<tr>
<td></td>
<td>Widgets</td>
<td>widgets</td>
</tr>
<tr>
<td></td>
<td>Menus</td>
<td>nav-menus</td>
</tr>
<tr>
<td></td>
<td>Editor</td>
<td>theme-editor</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Plugins</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>Plugins</td>
<td>plugins</td>
</tr>
<tr>
<td></td>
<td>Add New</td>
<td>plugin-install</td>
</tr>
<tr>
<td></td>
<td>Editor</td>
<td>plugin-editor</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Users</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>Users</td>
<td>users</td>
</tr>
<tr>
<td></td>
<td>Add New</td>
<td>user</td>
</tr>
<tr>
<td></td>
<td>Your Profile</td>
<td>profile</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Tools</td>
<td></td>
<td>tools</td>
</tr>
<tr>
<td></td>
<td>Import</td>
<td>import</td>
</tr>
<tr>
<td></td>
<td>Export</td>
<td>export</td>
</tr>
<tr>
<td></td>
<td>Network</td>
<td>network</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Settings</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>General</td>
<td>options-general</td>
</tr>
<tr>
<td></td>
<td>Writing</td>
<td>options-writing</td>
</tr>
<tr>
<td></td>
<td>Reading</td>
<td>options-reading</td>
</tr>
<tr>
<td></td>
<td>Discussion</td>
<td>options-discussion</td>
</tr>
<tr>
<td></td>
<td>Media</td>
<td>options-media</td>
</tr>
<tr>
<td></td>
<td>Privacy</td>
<td>options-privacy</td>
</tr>
<tr>
<td></td>
<td>Permalinks</td>
<td>options-permalink</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://cleverwp.com/current_screen-wordpress-global-variable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Multisite Search</title>
		<link>http://cleverwp.com/wordpress-multisite-search/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-multisite-search</link>
		<comments>http://cleverwp.com/wordpress-multisite-search/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 11:09:09 +0000</pubDate>
		<dc:creator>Lars Koudal</dc:creator>
				<category><![CDATA[WordPress Development Tips]]></category>

		<guid isPermaLink="false">http://cleverwp.com/?p=1244</guid>
		<description><![CDATA[A quick and simple solution for displaying search results from all subblogs on your WordPress 3 Multisite installation.]]></description>
			<content:encoded><![CDATA[<p>After the WordPress 3.0 release, a sought after solution have been a WordPress multisite search function across all blogs.</p>
<p>A recent project required just such a solution, and although there were some plugins already released both free or premium, they each had flaws in one way or another for the specific project.</p>
<p>The following solution is perfect for small WordPress multisite solutions, but make sure to read on after the code for a few comments about this solution.</p>
<p>&lt;h2&gt;WordPress Multisite Search&lt;/h2&gt;</p>
<p>To use the code, edit or create the search.php file in your current theme, and insert the following code:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

$searchfor = get_search_query(); // Get the search query for display in a headline
?&gt;
&lt;h1&gt;Search results for '&lt;?php echo $searchfor; ?&gt;'&lt;/h1&gt;

&lt;?php

 $query_string=esc_attr($query_string); // Escaping search queries to eliminate potential MySQL-injections
 $blogs = get_blog_list( 0,'all' );
 foreach ( $blogs as $blog ):
 switch_to_blog($blog['blog_id']);
 $search = new WP_Query($query_string);
 if ($search-&gt;found_posts&gt;0) {
 foreach ( $search-&gt;posts as $post ) {
 setup_postdata($post);
 $author_data = get_userdata(get_the_author_meta('ID'));
 ?&gt;
 &lt;div id=&quot;post-&lt;?php the_ID(); ?&gt;&quot; &lt;?php post_class(); ?&gt;&gt;
 &lt;p&gt;
 &lt;span&gt;&lt;?php the_time('Y/m/d') ?&gt;&lt;/span&gt;
 By &lt;?php the_author_posts_link();?&gt; &lt;/p&gt;
 &lt;h2&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
 &lt;div id=&quot;entry-content&quot;&gt;&lt;?php
 the_excerpt();

 ?&gt;
 &lt;/div&gt;

&lt;/div&gt;
&lt;?php

}

}
 endforeach;
 restore_current_blog(); // Reset settings to the current blog
?&gt;
</pre>
<p>The code is very simple, but can quickly become very resource demanding. The script runs through each subblog on your WordPress multisite blog, and displays the results in the layout you wish.</p>
<ul>
<li>The code above uses the function <a  href="http://codex.wordpress.org/WPMU_Functions/get_blog_list" target="_blank">get_blog_list()</a> which has been deprecated, but at the time of writing this there is no alternative function provided.</li>
<li>The search results are listed in the order found, meaning the first blogs will be displayed first.</li>
<li>The search results are not sorted by relevance.</li>
<li>There is no caching of search results.</li>
<li>The solution is best for small WordPress multisite installations.</li>
</ul>
<div class='et-box et-info'>
					<div class='et-box-content'><p>Note: Christopher Ross from The Helpful Coder has created a function to replace get_blog_list() in his post How to List all the Sites Hosted on a Multisite Install of WordPress 3.0.</p>
<p>I have not used his function in the example code above.</p></div></div>
]]></content:encoded>
			<wfw:commentRss>http://cleverwp.com/wordpress-multisite-search/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to publish on several WordPress Blogs</title>
		<link>http://cleverwp.com/how-to-publish-on-several-wordpress-blogs/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-publish-on-several-wordpress-blogs</link>
		<comments>http://cleverwp.com/how-to-publish-on-several-wordpress-blogs/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 22:04:58 +0000</pubDate>
		<dc:creator>Lars Koudal</dc:creator>
				<category><![CDATA[WordPress Development Tips]]></category>

		<guid isPermaLink="false">http://cleverwp.com/?p=1203</guid>
		<description><![CDATA[A friend of mine recently asked me of how to most effectively control content creation on several WordPress blogs, and that motivated me to dive into this quite lengthy article.]]></description>
			<content:encoded><![CDATA[<p>A friend of mine recently asked me of how to best (thereby meaning most easily) distribute content on to several WordPress blogs, and that motivated me to dive into this quite lengthy article.</p>
<p>There are two basic methods for distributing, quite opposite methods in fact, and they each have their pros and cons. Both require a bit of setting up on your WordPress installation, but a lot of that can be automatized in the creation-process.</p>
<h2>The PUSH metod &#8211; XML-RPC</h2>
<p>By enabling XML-RPC Remote Publishing on your WordPress blog, you can from a central software control a theoretically limitless range of WordPress installations. This sounds interesting, but there are indeed a few major setbacks. Let me explain.</p>
<h3>The pros</h3>
<p>*</p>
<h3>The cons</h3>
<h4>Security</h4>
<p>Firstly it opens a security threat on your WordPress blog. I am unaware of the actual stability and security of the XML-RPC protocol, it is arguably another open &#8220;hole&#8221; into your WordPress blog.</p>
<h4>Time consuming</h4>
<p>It takes time to set up. For each and every blog you make you need to both enable XML-RPC in your blogs settings, you also need to store this information in your central software for which you use to control your millions of WordPress blogs.</p>
<p>You can also get automatic content via this method. I wrote a blog post about it a while back, titled <a  href="http://cleverwp.com/neverending-free-content-for-your-blog/" target="_blank">How To Get Free Content For Your Blog Automatically</a>. I use <a  href="http://www.articlemarketingautomation.com/137061.html" target="_blank">Article Marketing Automation</a> (aff link) for unique content on some blogs.</p>
<p class="note">Note: If you use anything like above service I would recommend to create a new user in your WordPress installation with the role of &#8220;Author&#8221; for this. Why? Well, you&#8217;d be a nutter if you share your administrator password with anyone. Trusted or not.</p>
<p><em>* Yeah, I know. The &#8220;cons&#8221; section is empty. I simply can&#8217;t find a good reason to use this method, in comparison with the second method:</em></p>
<h2>The PULL method &#8211; The RSS feed</h2>
<p>Each WordPress installation has built-in RSS handling support for reading RSS feeds, and those who do not want to re-invent the wheel and code from scratch, there are already a few good plugins written to handle content creation via RSS feeds such as WP-o-Matic.</p>
<h3>The pros</h3>
<p class="note">Easy to maintain &#8211; One central server containing all your content. Easy.</p>
<p class="note">Expandable &#8211; Need more space? Need more speed? Upgrade a single server. Easy.</p>
<p class="note">Faster to set up. No need to enter the details for each blog in a central site. Easy.</p>
<p class="note">Flexible &#8211; You can communicate with the RSS feed via parameters, so with a bit of technical skill you can gradually start to scale. Read below in the section named &#8220;So exactly how does this work?&#8221;.</p>
<p class="note">Bonus benefit:<strong> Forced output structure = backwards compatibility</strong>. The strict structure of the RSS feed forces you to follow the RSS standards, otherwise the code is not able to understand your feed.<br />
Hence, if you add additional features in the future, such as new parameters and their handling, you are forced to keep the same structure of the output and that means all previous installations will still be able to communicate with the content server.</p>
<h3>The cons</h3>
<h4>Lack of tracking</h4>
<p>Being practical, I also use my centralized feed server for checking my slaves scattered around the internet, but doing this using a PULL technology requires extra effort and coding on your behalf.</p>
<p>The first method (XML-RPC) arguably has an advantage in this area, by immediately knowing if a blog fail to respond and time out when attempting to publish and alerting us to that.</p>
<p>However, you can achieve the same benefit from adding additional code to your feed script, which stores incoming visits from referring urls,  checks the incoming urls at specified intervals and reports any blogs not responding. This makes it a minor con, since it requires extra effort in setting up. The first time.</p>
<p style="padding-left: 30px;"><strong>Valuable tip: Add a bit of sanity!</strong></p>
<p style="padding-left: 30px;">If you choose to add the checking module, you would  be wise to add a buffer for responsiveness. Simply because a blog is not responding at the time your code checks it, it could simply be slow in responding at that moment, the pathways on the internet is clocked, or a range of other things.</p>
<p style="padding-left: 30px;">It should instead be noted and rechecked at least a couple more times before sending an alert to you, such as an email, a text message to your cellphone, or whatever you can think of&#8230;</p>
<p style="padding-left: 30px;">I also recommend to aggregate alerts to a few times a day. <em> </em></p>
<p style="padding-left: 30px;"><em>You <span style="text-decoration: underline;">REALLY</span> don&#8217;t want a piece of code going mental </em>and sending you text messages <span style="text-decoration: underline;">every 15 seconds</span> for some reason, starting at 2:32 am.</p>
<p style="padding-left: 30px;">It will usually happen when you are away on vacation somewhere without decent internet connection or time to fix it&#8230; Trust me.</p>
<h4>An investment</h4>
<p>An actual con however is the potential cost. I am a sucker for lowering my costs as much as reasonably possible, and I know of several places that offer only decent service, and for low prices. But the single important part in this setup is the server, and it should be as secure and stable as you need and can afford.</p>
<p>Depending on your kind of nerves and wallet-size, I highly recommend investing in a secure, stable, well-backed-up server, with 24/7 support. It costs more, but it makes you sleep peacefully at night.</p>
<h2>So how exactly does it work?</h2>
<p>Well, if you want to start off simple, you set up a range of WordPress Blogs with some RSS-to-content handling code, that checks a fixed RSS feed at random intervals such as twice daily, weekly or even monthly. The RSS feed will contain content controlled from the central server, and the local code will handle creating any new content into blogposts.</p>
<p>The central feed url, let&#8217;s say http://networkhq.com/feed.php, will return content from a database (or even a range of databases).</p>
<p>At it simplest, it simply returns random content delivered from a database. A more advanced version which you can develop at your leisure should/could contain several more features such as:</p>
<p><strong>Security</strong> &#8211; Add a parameter with a specific key, and fail to return anything if that parameter is missing. Example: <code>http://networkhq.com/feed.php&amp;<strong>secretkey=453Asd2</strong></code></p>
<p><strong>Keyword content</strong> &#8211; Add a parameter for keyword searching. Imagine having a centralized database of hundreds of thousands of articles, news and stories about &#8220;health&#8221; for instance. If you set up a range of blogs related to a specific keyword phrase, I can simply add <code>&amp;kw=acne</code> and output only content related to acne.</p>
<p><strong>Sorting method</strong> &#8211; You can output the content randomly if you want to fill up a blog gradually with content, or you can force the output returned by the server to display the latest first.</p>
<p><strong>Limiting </strong>- Limiting your output is always a good idea. It can be a way of controlling how much content is added to your blog at a time. Some RSS-handling scripts I have tested do not have a limiting feature, and you could end up getting 50 blogposts created every hour if you don&#8217;t keep some control and limitations.</p>
<p>There are several other things that can help you and increase the flexibility of the system, bring forth some of your own ideas in the comments, I would love to hear what you can think up.</p>
<p class="note">Expect a tutorial about setting up a specific system like this later on. I will start to work more on my WordPress tutorials series, so if you have any good ideas for a topic for such a tutorial, leave a note below in the comments please.</p>
]]></content:encoded>
			<wfw:commentRss>http://cleverwp.com/how-to-publish-on-several-wordpress-blogs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To Use Log Tables in WordPress Plugins</title>
		<link>http://cleverwp.com/how-to-use-log-tables-in-wordpress-plugins/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-use-log-tables-in-wordpress-plugins</link>
		<comments>http://cleverwp.com/how-to-use-log-tables-in-wordpress-plugins/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 16:57:05 +0000</pubDate>
		<dc:creator>Lars Koudal</dc:creator>
				<category><![CDATA[WordPress Development Tips]]></category>

		<guid isPermaLink="false">http://mywordpress.com/?p=1151</guid>
		<description><![CDATA[Using logging in WordPress Plugins for better usability for users.]]></description>
			<content:encoded><![CDATA[<p>For every bigger project I create I always add a log function, and through that I can use it to display debug information while I develop, and use the same functionality to display useful information to the users of the plugin.</p>
<p class="note"><a  href="http://cleverwp.com/seo-booster-pro2-teaser/" target="_blank">SEO Booster PRO </a>2 is in the works! Take a look at the new generation of powerful dynamic SEO for your WordPress Blogs</p>
<p>It helps fixing bugs, and also in many cases users grasp more of how the logic is working and what is going on simply by looking at a helpful log screen.</p>
<p>There are several ways of achieving this, but my preferred method is to create a separate database table for each plugin. In that table I store 3 simple pieces of information; a timestamp, the message and a priority value.</p>
<p>The priority value is used when displaying the log. The default value of log entries are 0, which means debug notices, etc. Use a unique id for each type of information. I use &#8217;1&#8242; for positive information delivery and &#8217;10&#8242; will display a red notice indicating something that should be taken care of.</p>
<h2>The Log Function</h2>
<pre class="brush: php; title: ; notranslate">
// ---------------------------
		/**
		*
		* LOG FUNCTION
		*
		*/
function log($text,$prio=0) {
    global $wpdb;
    $table_name_log = $wpdb-&gt;prefix . &quot;seobooster_log&quot;;
    $text= mysql_real_escape_string($text);
    $time= date('Y-m-d H:i:s ',time());
    $wpdb-&gt;query ($wpdb-&gt;prepare(&quot;INSERT INTO `$table_name_log` (time,note,prio)
    				  VALUES (
    				  '$time',
    				  '$text',
    				  '$prio'
    				  )&quot;));
    unset($query);
    unset($wpdb);
    unset($text);
    unset($time);
    unset($table_name_log);
}
//END LOG()
</pre>
<p>The function is simple, and wherever I want to save some information for the user, I make a simple call such as</p>
<pre>$this-&gt;log("Notice Text...");</pre>
<p>The priority is per default set to 0, which means I do not need to add a priority for low-importance notices.</p>
<p class="note">Some of you might notice that I get the current time from PHP and store that instead of using MySQL&#8217;s &#8220;NOW()&#8221; function. The reason is simple, some server setups report different times between the PHP server and MySQL server.</p>
<p>That is quite annoying when you want to present the log entries such as &#8220;1 minute and 32 seconds ago:&#8221; and the two different dates does not match up properly. This alleviates that problem.</p>
<h2>Make the user choose</h2>
<p>I am a big fan of user customization where it makes sense.  I try to simplify my plugins as much as possible, lowering the learning curve. The same goes for logging.</p>
<p>During installation and tweaking it can be helpful to have more detailed logging, but once everything is configured, there is no real purpose of storing tiny details, especially since that can make important notices appear further down and perhaps not get the attention it deserves.</p>
<p>For that reason I choose to add a check box in the settings, indicating if detailed logging is necessary or not, and every time I need to display something that is not highly important, I add a simple if-check in the code:</p>
<pre class="brush: php; title: ; notranslate">
if ($this-&gt;options['detailedlogging']) $this-&gt;log(&quot;_logkeyword() qref:'$qref' - pos:$pos&quot;);
</pre>
<h2>How to keep the size down</h2>
<p>Such a database table can quickly become very big, but there is a simple way to alleviate this problem.</p>
<pre class="brush: php; title: ; notranslate">
$log_table = $wpdb-&gt;prefix . &quot;seobooster_log&quot;;

$targettime = $wpdb-&gt;get_var($wpdb-&gt;prepare(&quot;SELECT `time` from `$log_table` order by `time` DESC limit 5000,1;&quot;));

if ($targettime) {
	$success= $wpdb-&gt;query ($wpdb-&gt;prepare(&quot;DELETE from `$log_table`  where `time` &lt; '$targettime';&quot;));
	if ($success) {
		// Query successful
	} else {
		// Error, fix it...
	}
}
</pre>
<p>Above code will make a check to get the timestamp of the 5001st log entry, and the following query will erase any entries older than that.</p>
<h2>Displaying the log</h2>
<p>I keep a separate &#8220;tab&#8221; in my plugins for the log, and for <a  href="http://cleverwp.com/seo-booster-pro2-teaser/" target="_blank">SEO Booster PRO 2</a>, I present two methods of viewing the log. The first is via AJAX, which updates every 10 seconds. No need to refresh at all.</p>
<div id="attachment_1134" class="wp-caption aligncenter" style="width: 310px"><a  href="http://cleverwp.com.s3.amazonaws.com/wp-content/uploads/2010/04/thelog.png" class="thickbox no_icon" rel="gallery-1151" title="AJAX Refresh Log"><img class="size-medium wp-image-1134" title="AJAX Refresh Log" src="http://cleverwp.com.s3.amazonaws.com/wp-content/uploads/2010/04/thelog-300x126.png" alt="thelog 300x126 How To Use Log Tables in WordPress Plugins" width="300" height="126" /></a><p class="wp-caption-text">AJAX Refresh Log</p></div>
<p>Furthermore, since displaying all 5000 entries in the AJAX div would be quite hard on your server, there is also a tab named &#8220;Archives&#8221;, which displays the latest 5000 log entries.</p>
<h2>User resetting?</h2>
<p>It&#8217;s a very simple thing to implement, so I tend to always add a manual reset function as well. It can be useful when you have made changes, and want to view only the process from now on.</p>
]]></content:encoded>
			<wfw:commentRss>http://cleverwp.com/how-to-use-log-tables-in-wordpress-plugins/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>All WordPress Options in one page</title>
		<link>http://cleverwp.com/all-wordpress-options-in-one-page/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=all-wordpress-options-in-one-page</link>
		<comments>http://cleverwp.com/all-wordpress-options-in-one-page/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 11:22:36 +0000</pubDate>
		<dc:creator>Lars Koudal</dc:creator>
				<category><![CDATA[WordPress Development Tips]]></category>

		<guid isPermaLink="false">http://mywordpress.com/?p=1044</guid>
		<description><![CDATA[Want to edit all your WordPress blog settings in one page? Find out how.]]></description>
			<content:encoded><![CDATA[<p>This might be an old trick, but it is still a definite speed improvement using this page when you are fine-tuning any WordPress blog.</p>
<p>You can gain access to all the settings &amp; options in WordPress by going to a single url:</p>
<p style="text-align: center;"><strong>http://<em>yourblog.com</em>/wp-admin/options.php</strong></p>
<p>Some forms of stored data is impossible to edit this way, such as serialized data, but you can tweak a lot of settings in one single place instead of going back and forth.</p>
<div id="attachment_1045" class="wp-caption aligncenter" style="width: 167px"><a  href="http://cleverwp.com.s3.amazonaws.com/wp-content/uploads/2010/01/all-wordpress-settings.jpg" class="thickbox no_icon" rel="gallery-1044" title="Some of the settings on this WordPress blog"><img class="size-medium wp-image-1045" title="Some of the settings on this WordPress blog" src="http://cleverwp.com.s3.amazonaws.com/wp-content/uploads/2010/01/all-wordpress-settings-157x300.jpg" alt="all wordpress settings 157x300 All WordPress Options in one page" width="157" height="300" /></a><p class="wp-caption-text">Some of the settings on this WordPress blog</p></div>
<p><em>Warning: You really should know what you are doing before attempting to do this. <strong>You can do a LOT of damage</strong> to your WordPress blog if you don&#8217;t know what you are doing.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://cleverwp.com/all-wordpress-options-in-one-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Post Title Outside &quot;The Loop&quot;</title>
		<link>http://cleverwp.com/get-post-title-outside-the-loop/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=get-post-title-outside-the-loop</link>
		<comments>http://cleverwp.com/get-post-title-outside-the-loop/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 08:13:17 +0000</pubDate>
		<dc:creator>Lars Koudal</dc:creator>
				<category><![CDATA[WordPress Development Tips]]></category>

		<guid isPermaLink="false">http://mywordpress.com/?p=980</guid>
		<description><![CDATA[Getting individual post data outside The Loop in WordPress is easy with a few lines of code...:]]></description>
			<content:encoded><![CDATA[<p>Getting individual post data outside the loop can be difficult, but you can quickly get the information you want if you have the id of the post you are trying to get information from:</p>
<p>Use the following code to get the information:</p>
<pre class="brush: php; title: ; notranslate">
global $wpdb;
$postid='1'; // replace this with the postid you are trying to access.
$postdata= $wpdb-&gt;get_results(&quot;SELECT * FROM $wpdb-&gt;posts WHERE ID=$postid&quot;);
</pre>
<p>To access and use the data is equally easy, here are some examples to get you started:</p>
<pre class="brush: php; title: ; notranslate">
echo $postdata-&gt;post_title; //The title of the post
echo $postdata-&gt;post_content; //The content of the post
</pre>
<p>There is other useful information you can grab via this method:</p>
<ul>
<li>post_author</li>
<li>post_date</li>
<li>post_date_gmt</li>
<li>post_content</li>
<li>post_title</li>
<li>post_category</li>
<li>post_excerpt</li>
<li>post_status,</li>
<li>comment_status</li>
<li>ping_status</li>
<li>post_password</li>
<li>post_name</li>
<li>to_ping</li>
<li>pinged</li>
<li>post_modified</li>
<li>post_modified_gmt</li>
<li>post_content_filtered</li>
<li>post_parent</li>
<li>guid</li>
<li>menu_order</li>
<li>post_type</li>
<li>post_mime_type</li>
<li>comment_count</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://cleverwp.com/get-post-title-outside-the-loop/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: cleverwp.com @ 2012-02-05 06:13:01 by W3 Total Cache -->
