# articles

feed_id: http://benimarine.wordpress.com/?p=30
title: Facebook Integration for WordPress
uri: Facebook-Integration-for-WordPress
url: https://benimarine.wordpress.com/2013/06/08/facebook-integration-for-wordpress/
content:
<div>
<p>Starting today WordPress publishers can easily integrate Facebook features, such as social publishing and mentions, through the new <a href="https://developers.facebook.com/wordpress/">Facebook for WordPress plugin</a>.</p>
<p>The plugin was built by Facebook engineers in collaboration with open source partners, and makes it simple for anyone to make their WordPress site more social – no coding required. The plugin will also work on mobile and support internationalization.</p>
<h2>Social Publishing</h2>
<p>Once the plugin is installed, you can cross-post content published to WordPress to your Facebook Timeline and the Facebook Pages you manage. You can also mention the names of Pages and friends as you post to further distribute your content.</p>
<p><img alt="" src="media/5792b352.wp_blog_mentions.png" data-original-source="https://developers.facebook.com/attachment/wp_blog_mentions.png" /></p>
<h2>WordPress Widgets</h2>
<p>The following social plugins are available as WordPress widgets:</p>
<ul>
<li><a href="https://developers.facebook.com/docs/reference/plugins/activity/">Activity Feed</a>: Shows readers their friends’ activity on the site, such as likes and comments.</li>
<li>Recommendations: Gives readers personalized suggestions for pages on your site they might like, as well as a Recommendations Bar option to give users the option to add content to their Timeline as they read.</li>
<li>Customizable <a href="https://developers.facebook.com/docs/reference/plugins/like/">Like</a>, <a href="https://developers.facebook.com/docs/reference/plugins/subscribe/">Subscribe</a> and <a href="https://developers.facebook.com/docs/reference/plugins/send/">Send</a> buttons.</li>
<li><a href="https://developers.facebook.com/docs/reference/plugins/comments/">Comments Box</a>: Makes it easy for people to comment on your site and post back to Facebook, and includes moderation tools. The plugin also features automatic SEO support for Facebook Comments, so search engines can index them to improve your site’s visibility.</li>
</ul>
<p><a href="http://techcrunch.com/">TechCrunch</a>, <a href="http://www.buzz-media.com/">Buzz Media</a> and <a href="http://thenextweb.com/">The Next Web</a> are already using the plugin to connect with their audiences while providing users with more engaging and personalized experiences. The plugin is available for all sites on WordPress.com VIP as well.</p>
<p>WordPress powers 16.6 percent of the web, from The New York Times to People Magazine, and attracts more than 600 million unique visitors each month. We hope the plugin makes it possible for WordPress content to be shared even more widely among people.</p>
<p><a href="https://developers.facebook.com/wordpress/">Learn more</a> or <a href="http://wordpress.org/extend/plugins/facebook">download the plugin now</a>.</p>
</div><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benimarine.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benimarine.wordpress.com/30/" /></a> <img alt="" border="0" src="https://pixel.wp.com/b.gif?host=benimarine.wordpress.com&#038;blog=19488602&#038;post=30&#038;subd=benimarine&#038;ref=&#038;feed=1" width="1" height="1" />


feed_id: http://benimarine.wordpress.com/?p=27
title: Query or show a specific post in wordpress
uri: Query-or-show-a-specific-post-in-wordpress
url: https://benimarine.wordpress.com/2013/06/08/query-or-show-a-specific-post-in-wordpress/
content:
<p>If you are looking for php code or a plugin for your WordPress that takes a post ID and returns the database record for that post then read on. This is very helpful when you want to show a specific post on your homepage or other pages to get more attention. It allows you to design your homepage or a page with the post(s) that you want to be shown on the page rather than the 10 recent posts that the WordPress automatically chooses for you.</p>
<h3><strong>PHP Code Example to Query a WordPress Post</strong></h3>
<h4>Example 1</h4>
<p>The following code will Query the post with post id 26 and Show the title and the content.<br />
<code><br />
&lt;?php<br />
$post_id = 26;<br />
$queried_post = get_post($post_id);<br />
$title = $queried_post-&gt;post_title;<br />
echo $title;<br />
echo $queried_post-&gt;post_content;<br />
?&gt;<br />
</code></p>
<h4>Example 2</h4>
<p>The following style could be more useful as it lets the user customise the font easily.<br />
<code><br />
&lt;?php<br />
$post_id = 26;<br />
$queried_post = get_post($post_id);<br />
?&gt;<br />
&lt;h2&gt;&lt;?php echo $queried_post-&gt;post_title; ?&gt;&lt;/h2&gt;<br />
&lt;?php echo $queried_post-&gt;post_content; ?&gt;<br />
</code></p>
<h4>Example 3</h4>
<p>Using an Array… The following code will query every post number in ‘thePostIdArray’ and show the title of those posts.<br />
<code><br />
&lt;?php $thePostIdArray = array("28","74", "82", "92"); ?&gt;<br />
&lt;?php $limit = 4 ?&gt;<br />
&lt;?php if (have_posts()) : ?&gt;<br />
&lt;?php while (have_posts()) : the_post(); $counter++; ?&gt;<br />
&lt;?php if ( $counter &lt; $limit + 1 ): ?&gt;<br />
&lt;div id="post-&lt;?php the_ID(); ?&gt;"&gt;<br />
&lt;?php $post_id = $thePostIdArray[$counter-1]; ?&gt;<br />
&lt;?php $queried_post = get_post($post_id); ?&gt;<br />
&lt;h2&gt;&lt;?php echo $queried_post-&gt;post_title; ?&gt;&lt;/h2&gt;<br />
&lt;/div&gt;<br />
&lt;?php endif; ?&gt;<br />
&lt;?php endwhile; ?&gt;<br />
&lt;?php endif; ?&gt;<br />
</code></p>
<h3>How to Display the Post Content Like WordPress</h3>
<p>When you retrieve the post content from the database you get the unfiltered content. If you want to achieve the same output like WordPress does in its’ posts or pages then you need to apply filter to the content. You can use the following code:</p>
<p><code>&lt;?php<br />
$post_id = 26;<br />
$queried_post = get_post($post_id);<br />
$content = $queried_post-&gt;post_content;<br />
$content = apply_filters('the_content', $content);<br />
$content = str_replace(']]&gt;', ']]&amp;gt;', $content);<br />
echo $content;<br />
?&gt;<br />
</code><br />
<strong>For a range of all the returned fields that you can use, check the WordPress site </strong><a href="http://codex.wordpress.org/Function_Reference/get_post" rel="nofollow">here</a>.</p>
<h3>Query X Number of Recent Posts</h3>
<p>You can use the “wp_get_recent_posts” function to retrieve X number of recent posts and then display them however you want to. Here is an example:</p>
<pre>&lt;?php
//Query 5 recent published post in descending order
$args = array( 'numberposts' =&gt; '5', 'order' =&gt; 'DESC','post_status' =&gt; 'publish' );
$recent_posts = wp_get_recent_posts( $args );
//Now lets do something with these posts
foreach( $recent_posts as $recent )
{
    echo 'Post ID: '.$recent["ID"];
    echo 'Post URL: '.get_permalink($recent["ID"]);
    echo 'Post Title: '.$recent["post_title"];
    //Do whatever else you please with this WordPress post
}
?&gt;</pre>
<p><strong>Using a Plugin to List all Posts Alphabetically</strong></p>
<p>You can also use the <a href="http://www.tipsandtricks-hq.com/?p=4873">WP Alphabetic Listing</a> WordPress plugin to list all your posts.</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benimarine.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benimarine.wordpress.com/27/" /></a> <img alt="" border="0" src="https://pixel.wp.com/b.gif?host=benimarine.wordpress.com&#038;blog=19488602&#038;post=27&#038;subd=benimarine&#038;ref=&#038;feed=1" width="1" height="1" />


feed_id: http://benimarine.wordpress.com/?p=25
title: Post on your WordPress blog using PHP
uri: Post-on-your-WordPress-blog-using-PHP
url: https://benimarine.wordpress.com/2013/06/08/post-on-your-wordpress-blog-using-php/
content:
<p>Here is the function. This code is not made for being used within WordPress, so don&#8217;t paste it on your functions.php file (or any other).</p>
<p>Please note that you must activate the XMLRPC posting option in your WordPress blog. If this option isn&#8217;t activated, the code will not be able to insert anything into your blog database. Another thing, make sure the XMLRPC functions are activated on your <em>php.ini</em> file.</p>
<pre>function wpPostXMLRPC($title,$body,$rpcurl,$username,$password,$category,$keywords='',$encoding='UTF-8') {
    $title = htmlentities($title,ENT_NOQUOTES,$encoding);
    $keywords = htmlentities($keywords,ENT_NOQUOTES,$encoding);

    $content = array(
        'title'=&gt;$title,
        'description'=&gt;$body,
        'mt_allow_comments'=&gt;0,  // 1 to allow comments
        'mt_allow_pings'=&gt;0,  // 1 to allow trackbacks
        'post_type'=&gt;'post',
        'mt_keywords'=&gt;$keywords,
        'categories'=&gt;array($category)
    );
    $params = array(0,$username,$password,$content,true);
    $request = xmlrpc_encode_request('metaWeblog.newPost',$params);
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
    curl_setopt($ch, CURLOPT_URL, $rpcurl);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 1);
    $results = curl_exec($ch);
    curl_close($ch);
    return $results;
?&gt;</pre><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benimarine.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benimarine.wordpress.com/25/" /></a> <img alt="" border="0" src="https://pixel.wp.com/b.gif?host=benimarine.wordpress.com&#038;blog=19488602&#038;post=25&#038;subd=benimarine&#038;ref=&#038;feed=1" width="1" height="1" />


feed_id: http://benimarine.wordpress.com/?p=23
title: WordPress $post Object Quick Reference
uri: WordPress-post-Object-Quick-Reference
url: https://benimarine.wordpress.com/2013/06/08/wordpress-post-object-quick-reference/
content:
<h2>How to use the $post object</h2>
<p>The values in the chart below can be accessed for a given post within the loop using the following syntax:</p>
<div>
<div id="highlighter_521258">
<div><a href="http://www.rlmseo.com/blog/wordpress-post-variable-quick-reference/#">?</a></div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
</td>
<td>
<div>
<div><code>$post</code><code>-&gt;</code><code>$key</code><code>;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>…where key is the property you want to access below. For example, you’ll notice at the top of this post is a post summary within a formatted div element. The summary is just a formatted version of the post excerpt, but if there’s no post excerpt I don’t want that div element showing up empty, so in that case, I hide it using the following code:</p>
<div>
<div id="highlighter_619917">
<div><a href="http://www.rlmseo.com/blog/wordpress-post-variable-quick-reference/#">?</a></div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
</td>
<td>
<div>
<div><code>&lt;?php</code></div>
<div><code>if</code><code>(</code><code>$post</code><code>-&gt;post_excerpt != </code><code>''</code><code>) :</code></div>
<div><code>    </code><code>echo</code> <code>'&lt;div id="summary"&gt;'</code><code>;</code></div>
<div><code>    </code><code>echo</code> <code>'&lt;strong&gt;Summary:&lt;/strong&gt;&lt;br /&gt;'</code><code>;</code></div>
<div><code>    </code><code>the_excerpt();</code></div>
<div><code>    </code><code>echo</code> <code>'&lt;/div&gt;'</code><code>;</code></div>
<div><code>endif</code><code>;</code></div>
<div><code>?&gt;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h2>$post Object properties</h2>
<table>
<tbody>
<tr>
<th>Property</th>
<th>Sample Value</th>
<th>Notes</th>
</tr>
<tr>
<td>post_author</td>
<td>1</td>
<td>Post author’s user number</td>
</tr>
<tr>
<td>post_date</td>
<td>2008-03-15 19:22:29</td>
<td></td>
</tr>
<tr>
<td>post_date_gmt</td>
<td>2008-03-16 02:22:29</td>
<td>GMT = Greenwich Mean Time</td>
</tr>
<tr>
<td>post_content</td>
<td></td>
<td>Actual post content, including markup</td>
</tr>
<tr>
<td>post_title</td>
<td></td>
<td>Post title</td>
</tr>
<tr>
<td>post_category</td>
<td>0</td>
<td>Number representing post category ID#</td>
</tr>
<tr>
<td>post_excerpt</td>
<td></td>
<td>Plain text without markup</td>
</tr>
<tr>
<td>post_status</td>
<td>publish, pending, draft, private, inherit</td>
<td>Current status of the post</td>
</tr>
<tr>
<td>comment_status</td>
<td>open</td>
<td>Possible values: open / closed</td>
</tr>
<tr>
<td>ping_status</td>
<td>open</td>
<td>open / closed</td>
</tr>
<tr>
<td>post_password</td>
<td></td>
<td>Will be empty if no password</td>
</tr>
<tr>
<td>post_name</td>
<td>statistics</td>
<td>Same as post slug</td>
</tr>
<tr>
<td>to_ping</td>
<td><a href="http://www.1to-ping.com" rel="nofollow">http://www.1to-ping.com</a>, <a href="http://www.2to-ping.com" rel="nofollow">http://www.2to-ping.com</a>, <a href="http://www.3to-ping.com" rel="nofollow">http://www.3to-ping.com</a></td>
<td>List of urls to ping when post is published (for unpublished posts)</td>
</tr>
<tr>
<td>pinged</td>
<td><a href="http://www.pinged1.com" rel="nofollow">http://www.pinged1.com</a>, <a href="http://www.pinged2.com" rel="nofollow">http://www.pinged2.com</a>, <a href="http://www.pinged3.com" rel="nofollow">http://www.pinged3.com</a></td>
<td>List of urls that have been pinged (for published posts)</td>
</tr>
<tr>
<td>post_modified</td>
<td>2008-07-01 19:41:28</td>
<td>Date the post was last modified</td>
</tr>
<tr>
<td>post_modified_gmt</td>
<td>2008-07-02 02:41:28</td>
<td>GMT date post was last modified</td>
</tr>
<tr>
<td>post_content_filtered</td>
<td></td>
<td>Exists to store a cached version of post content (most likely with all the the_content filters already applied). If you’ve got a plugin that runs a very resource heavy filter on content, you might consider caching the results with post_content_filtered, and calling that from the front end instead.</td>
</tr>
<tr>
<td>post_parent</td>
<td></td>
<td>ID# of this post’s parent. In the case of attachments, will be the post it’s attached to. Defaults to 0 if no parent.</td>
</tr>
<tr>
<td>guid</td>
<td><a href="http://www.blogurl/postslug" rel="nofollow">http://www.blogurl/postslug</a></td>
<td>Global Unique Identifier. The “real” URL to the post, not the permalink version. For pages, this is the actual URL. In the case of files (attachments), this holds the URL to the file.</td>
</tr>
<tr>
<td>menu_order</td>
<td>0<br />
1<br />
2<br />
etc…</td>
<td>Holds values for display order of pages. Only works with pages, not posts.</td>
</tr>
<tr>
<td>post_type</td>
<td>page<br />
post<br />
attachment<br />
revision</td>
<td>Self-explanatory for pages and posts. Any files uploaded are attachments and post revisions saved as revision</td>
</tr>
<tr>
<td>post_mime_type</td>
<td>text/html<br />
image/png<br />
image/jpg</td>
<td>Only used for files (attachments). Contains the MIME type of the uploaded file.</td>
</tr>
<tr>
<td>comment_count</td>
<td>4</td>
<td>Number of comments, pings, and trackbacks combined</td>
</tr>
</tbody>
</table>
<p><em>Thanks to everyone who commented on this post to help fill in some of the missing values!</em></p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benimarine.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benimarine.wordpress.com/23/" /></a> <img alt="" border="0" src="https://pixel.wp.com/b.gif?host=benimarine.wordpress.com&#038;blog=19488602&#038;post=23&#038;subd=benimarine&#038;ref=&#038;feed=1" width="1" height="1" />


feed_id: http://benimarine.wordpress.com/?p=21
title: Function Reference/get post
uri: Function-Reference-get-post
url: https://benimarine.wordpress.com/2013/06/08/function-referenceget-post/
content:
<h2><span class="mw-headline">Description</span></h2>
<p>Takes a post ID and returns the database record for that post. You can specify, by means of the <tt>$output</tt> parameter, how you would like the results returned.</p>
<p><a id="Usage" name="Usage"></a></p>
<h2><span class="mw-headline">Usage</span></h2>
<p><code><span style="color:#000000;"> <span style="color:#0000bb;">&lt;?php get_post</span><span style="color:#007700;">( </span><span style="color:#0000bb;">$id</span><span style="color:#007700;">, </span><span style="color:#0000bb;">$output</span><span style="color:#007700;">, </span><span style="color:#0000bb;">$filter </span><span style="color:#007700;">); </span><span style="color:#0000bb;">?&gt;</span> </span> </code></p>
<p><a id="Parameters" name="Parameters"></a></p>
<h2><span class="mw-headline">Parameters</span></h2>
<dl>
<dt><tt>$id</tt></dt>
<dd>(<a title="How to Pass Tag Parameters" href="http://codex.wordpress.org/How_to_Pass_Tag_Parameters#Integer_or_object"><i>integer or object</i></a>) (<i>optional</i>) The ID of the post you&#8217;d like to fetch, or an object that specifies the post. By default the current post is fetched.
<dl>
<dd>Default: null</dd>
</dl>
</dd>
</dl>
<dl>
<dt><tt>$output</tt></dt>
<dd>(<a title="How to Pass Tag Parameters" href="http://codex.wordpress.org/How_to_Pass_Tag_Parameters#String"><i>string</i></a>) (<i>optional</i>) How you&#8217;d like the result.</p>
<ul>
<li><i>OBJECT</i> &#8211; (<i>default</i>) returns a WP_Post object</li>
<li><i>ARRAY_A</i> &#8211; Returns an associative array of field names to values</li>
<li><i>ARRAY_N</i> &#8211; returns a numeric array of field values</li>
</ul>
<dl>
<dd>Default: OBJECT</dd>
</dl>
</dd>
</dl>
<dl>
<dt><tt>$filter</tt></dt>
<dd>(<a title="How to Pass Tag Parameters" href="http://codex.wordpress.org/How_to_Pass_Tag_Parameters#String"><i>string</i></a>) (<i>optional</i>) Filter the post.</p>
<ul>
<li><i>raw</i> &#8211; (<i>default</i>)</li>
</ul>
<dl>
<dd>Default: raw</dd>
</dl>
</dd>
</dl>
<p><a id="Example" name="Example"></a></p>
<h2><span class="mw-headline">Example</span></h2>
<p>To get the title for a post with ID 7:</p>
<p><code><span style="color:#000000;"> <span style="color:#0000bb;">&lt;?php<br />
$post_7 </span><span style="color:#007700;">= </span><span style="color:#0000bb;">get_post</span><span style="color:#007700;">(</span><span style="color:#0000bb;">7</span><span style="color:#007700;">);<br />
</span><span style="color:#0000bb;">$title </span><span style="color:#007700;">= </span><span style="color:#0000bb;">$post_7</span><span style="color:#007700;">-&gt;</span><span style="color:#0000bb;">post_title</span><span style="color:#007700;">;<br />
</span><span style="color:#0000bb;">?&gt;</span> </span> </code></p>
<p>Alternatively, specify the <tt>$output</tt> parameter:</p>
<p><code><span style="color:#000000;"> <span style="color:#0000bb;">&lt;?php<br />
$post_7 </span><span style="color:#007700;">= </span><span style="color:#0000bb;">get_post</span><span style="color:#007700;">(</span><span style="color:#0000bb;">7</span><span style="color:#007700;">, </span><span style="color:#0000bb;">ARRAY_A</span><span style="color:#007700;">);<br />
</span><span style="color:#0000bb;">$title </span><span style="color:#007700;">= </span><span style="color:#0000bb;">$post_7</span><span style="color:#007700;">[</span><span style="color:#dd0000;">'post_title'</span><span style="color:#007700;">];<br />
</span><span style="color:#0000bb;">?&gt;</span> </span> </code></p>
<p><a id="Return" name="Return"></a></p>
<h2><span class="mw-headline">Return</span></h2>
<p>Returns a <tt><b><a title="Class Reference/WP Post" href="http://codex.wordpress.org/Class_Reference/WP_Post">WP_Post</a></b></tt> object, or <tt><b>null</b></tt> on failure.</p>
<p>The fields returned are:</p>
<dl>
<dt><tt>ID</tt> </dt>
<dd>(<i>integer</i>) The post ID</dd>
<dt><tt>post_author</tt> </dt>
<dd>(<i>integer</i>) The post author&#8217;s ID</dd>
<dt><tt>post_date</tt> </dt>
<dd>(<i>string</i>) The datetime of the post (<tt>YYYY-MM-DD HH:MM:SS</tt>)</dd>
<dt><tt>post_date_gmt</tt> </dt>
<dd>(<i>string</i>) The GMT datetime of the post (<tt>YYYY-MM-DD HH:MM:SS</tt>)</dd>
<dt><tt>post_content</tt> </dt>
<dd>(<i>string</i>) The post&#8217;s contents</dd>
<dt><tt>post_title</tt> </dt>
<dd>(<i>string</i>) The post&#8217;s title</dd>
<dt><tt>post_category</tt> </dt>
<dd>(<i>integer</i>) The post category&#8217;s ID. Note that this will always be 0 (zero) from wordpress 2.1 onwards. To determine a post&#8217;s category or categories, use <a title="Function Reference/get the category" href="http://codex.wordpress.org/Function_Reference/get_the_category">get_the_category()</a>.</dd>
<dt><tt>post_excerpt</tt> </dt>
<dd>(<i>string</i>) The post excerpt</dd>
<dt><tt>post_status</tt> </dt>
<dd>(<i>string</i>) The post status (<tt>publish|pending|draft|private|static|object|attachment|inherit|future|trash</tt>)</dd>
<dt><tt>comment_status</tt> </dt>
<dd>(<i>string</i>) The comment status (<tt>open|closed|registered_only</tt>)</dd>
<dt><tt>ping_status</tt> </dt>
<dd>(<i>string</i>) The pingback/trackback status (<tt>open|closed</tt>)</dd>
<dt><tt>post_password</tt> </dt>
<dd>(<i>string</i>) The post password</dd>
<dt><tt>post_name</tt> </dt>
<dd>(<i>string</i>) The post&#8217;s URL slug</dd>
<dt><tt>to_ping</tt> </dt>
<dd>(<i>string</i>) URLs to be pinged</dd>
<dt><tt>pinged</tt> </dt>
<dd>(<i>string</i>) URLs already pinged</dd>
<dt><tt>post_modified</tt> </dt>
<dd>(<i>string</i>) The last modified datetime of the post (<tt>YYYY-MM-DD HH:MM:SS</tt>)</dd>
<dt><tt>post_modified_gmt</tt> </dt>
<dd>(<i>string</i>) The last modified GMT datetime of the post (<tt>YYYY-MM-DD HH:MM:SS</tt>)</dd>
<dt><tt>post_content_filtered</tt> </dt>
<dd>(<i>string</i>)</dd>
<dt><tt>post_parent</tt> </dt>
<dd>(<i>integer</i>) The parent post&#8217;s ID (for attachments, etc)</dd>
<dt><tt>guid</tt> </dt>
<dd>(<i>string</i>) A link to the post. Note: One cannot rely upon the GUID to be the permalink (as it was previous to version 2.5), Nor can you expect it to be a valid link to the post. It&#8217;s merely a unique identifier, which so happens to be a link to the post at present.</dd>
<dt><tt>menu_order</tt> </dt>
<dd>(<i>integer</i>)</dd>
<dt><tt>post_type</tt> </dt>
<dd>(<i>string</i>) (<tt>post|page|attachment</tt>)</dd>
<dt><tt>post_mime_type</tt> </dt>
<dd>(<i>string</i>) Mime Type (for attachments, etc)</dd>
<dt><tt>comment_count</tt> </dt>
<dd>(<i>integer</i>) Number of comments</dd>
</dl>
<p><a id="Notes" name="Notes"></a></p>
<h2><span class="mw-headline"> Notes </span></h2>
<p>Before version 3.5, the first parameter <tt>$post</tt> was required to be a variable. For example, <tt>get_post(7)</tt> would cause a fatal error.</p>
<p><a id="Source_File" name="Source_File"></a></p>
<h2><span class="mw-headline"> Source File </span></h2>
<p><tt>get_post()</tt> is located in <code><a class="external text" title="http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/post.php#L0" href="http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/post.php#L0">wp-includes/post.php</a></code> and <code><a class="external text" title="http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/class-wp-atom-server.php#L0" href="http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/class-wp-atom-server.php#L0">wp-includes/class-wp-atom-server.php</a></code>.</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benimarine.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benimarine.wordpress.com/21/" /></a> <img alt="" border="0" src="https://pixel.wp.com/b.gif?host=benimarine.wordpress.com&#038;blog=19488602&#038;post=21&#038;subd=benimarine&#038;ref=&#038;feed=1" width="1" height="1" />


feed_id: http://benimarine.wordpress.com/?p=18
title: The State of SEO and My Public Niche Site Project
uri: The-State-of-SEO-and-My-Public-Niche-Site-Project
url: https://benimarine.wordpress.com/2013/06/08/the-state-of-seo-and-my-public-niche-site-project/
content:
<div id="inner-content">
<div id="post-2504">
<div id="single"><a title="Podcast 16: The State of SEO and My Public Niche Site Project" href="media/61ced0b4.emailoptinform.png" data-original-source="http://www.nichepursuits.com/wp-content/uploads/2013/04/emailoptinform.png" rel="lightbox"><img title="Podcast 16: The State of SEO and My Public Niche Site Project" alt="Podcast 16: The State of SEO and My Public Niche Site Project" src="http://www.nichepursuits.com/wp-content/themes/download/einat/timthumb.php?src=https://i0.wp.com/www.nichepursuits.com/wp-content/uploads/2013/04/emailoptinform.png&amp;h=150&amp;w=150&amp;zc=1" width="150" height="150" /></a>A new podcast is here!</p>
<p>I felt like it was time that I sat behind the microphone and shared a few of my thoughts on the current state of SEO and my <a title="Niche Site Project 1 Overview" href="http://www.nichepursuits.com/niche-site-project-1-overview/">public niche site project</a>.  In fact, as I look back at <a title="Podcast 15: Building a Niche eCommerce Business with Nathan Hartnett" href="http://www.nichepursuits.com/podcast-15-building-a-niche-ecommerce-business-with-nathan-hartnett/">when I published my last podcast</a>, its been over 4 months!  What I think you will find here are some motivational words to help you see how I view the world of Search Engine Optimization and more.</p>
<p>In addition, I cover a few topics in regards to my niche site project that I haven’t mentioned previously on my blog yet.  So, its definitely worth a listen.  Here’s is some of the information I cover in the podcast:</p>
<h3>The State of SEO</h3>
<p>Overall, I believe that the state of SEO is very good.  Meaning, I believe that now is just as good a time as any to build and rank niche websites in Google.</p>
<p>I share a couple of pieces of evidence to support this claim.  First, I think I’ve done a decent job showing that its very possible to build and rank a niche website with my <a title="Niche Site Project 1 Overview" href="http://www.nichepursuits.com/niche-site-project-1-overview/" target="_blank">survival knife site for my niche site project</a>.  This is proof that you can type into Google and see for yourself, so you don’t really have to take my word for it.</p>
<p>However, I often find myself looking to other companies when I want some extra motivation.  One such company that I check in on from time to time is <a href="http://www.demandmedia.com/">Demand Media, Inc.</a>  The company is publicly traded on the NYSE under the <a href="http://finance.yahoo.com/q?s=DMD">ticker symbol DMD</a>.</p>
<p>If you are not familiar with Demand Media, they own the websites: <a href="http://www.eHow.com" target="_blank">eHow.com</a>, <a href="http://LiveStrong.com" target="_blank">LiveStrong.com</a>, <a href="http://Cracked.com" target="_blank">Cracked.com</a>, and many others.  I often look to this company for inspiration because they are employing the exact same business strategy that I am for my business!  Yes, they own much larger websites and implement this strategy on a much larger scale, but at its core, the strategy is really the same.</p>
<p>Demand Media does lots of market and keyword research, and once they find a low competition keyword based on their own formula, they hire freelance writers to create an article on the topic.  Then the article gets posted on ehow.com where it gets free traffic from Google and makes money from Google Adsense or other contextual ads.</p>
<p>Sound familiar?</p>
<p>This is essentially what I do with my niche websites.</p>
<p>So, I get my inspiration when I look at their financials and see growth.  Below is a copy of their quarterly income statement:</p>
<p><a href="media/595e61f1.demandmediaincome.png" data-original-source="http://www.nichepursuits.com/wp-content/uploads/2013/04/demandmediaincome.png"><img alt="demandmediaincome" src="media/27d8533a.demandmediaincome.png" data-original-source="https://i0.wp.com/www.nichepursuits.com/wp-content/uploads/2013/04/demandmediaincome.png" width="563" height="521" /></a></p>
<p>You will see that they are clearly growing.  They had a net loss for the quarter ending Mar. 30th, 2012, but have since seen increasing net incomes for the next 3 quarters.  This is encouraging, because the 2011 and 2012 were shaky years for SEO with the Panda and Penguin Google updates.</p>
<p>So, clearly Demand Media has <a href="http://www.webpronews.com/demand-media-posts-record-revenue-and-profitability-2012-11">found a way to continue to grow after these updates</a>.</p>
<p>And so have I.</p>
<h3>My Public Niche Site Project</h3>
<p>Despite some setbacks in 2011 and 2012 with all the Google changes (and <a title="I Just Got Banned From Google Adsense!  Now What?" href="http://www.nichepursuits.com/i-just-got-banned-from-google-adsense-now-what/">my Google Adsense account mishap</a>…and by the way I <a title="Welcome Back to Google Adsense!" href="http://www.nichepursuits.com/welcome-back-to-google-adsense/">still have my new Adsense account</a> open and all is well); I am seeing some real success in 2013.  In fact the last few sites that I’ve built have all reached page one of Google.</p>
<p>So, what does this mean?  To me it means that I’ve learned and improved my processes.  What I was doing in 2011 and even early 2012 does not work anymore.  This is exactly what Demand Media has done as well…we’ve shifted our tactics slightly.</p>
<p>If you are just starting out in the niche website business, I actually think you are lucky!  You can start doing things the right way and hopefully never experience some of the big penalties that have happened over the past couple of years.</p>
<p>On the podcast, I shared some of the traffic and earning numbers for the site.  The past few days I’ve been getting 500 unique visitors per day to my survival knife site!  This is huge.  Now obviously some of that is from my blog readers here, but how much is tough to quantify.</p>
<p>However, I AM selling lots of survival knifes, and I don’t think that’s coming from you <img alt=":)" src="media/8a93d735.icon_smile.gif" data-original-source="https://i0.wp.com/www.nichepursuits.com/wp-includes/images/smilies/icon_smile.gif" /> .  As of yesterday, I’ve made about $120 in Amazon Associates revenue for the month of April.  I hope to hit at least $250 for this month, and then $500 for the month of May.</p>
<p><a href="media/913a77a9.googleanalyticsapril15.png" data-original-source="http://www.nichepursuits.com/wp-content/uploads/2013/04/googleanalyticsapril15.png"><img alt="googleanalyticsapril15" src="media/8a97e355.googleanalyticsapril15.png" data-original-source="https://i0.wp.com/www.nichepursuits.com/wp-content/uploads/2013/04/googleanalyticsapril15.png" width="556" height="273" /></a></p>
<p>Click to Enlarge</p>
<p>In order to increase the amount I’m making on the site I have 3 plans.  Rank higher.  Add more content.  Add an email list.</p>
<p>In fact, just yesterday I added an email opt-in form to the site to start collecting email addresses.  I currently have 4 emails that will go out in an auto-responder series that essentially drive people to different pages of my website.  So, once people are on my email list, I can drive them to individual knife reviews or my knife chart to get more clicks, and hopefully purchases.</p>
<p>However, I am also on the lookout for good survival related affiliate products.  I’m sure there are some good survival or emergency preparedness ebooks, but I haven’t found the right one yet.  Once I do, I will be able to add this to my email marketing plan to further monetize my site.</p>
<p>Here’s what my email opt-in form looks like (just a template <a href="http://www.nichepursuits.com/aweber">provided by Aweber</a>):</p>
<p><a href="media/61ced0b4.emailoptinform.png" data-original-source="http://www.nichepursuits.com/wp-content/uploads/2013/04/emailoptinform.png"><img alt="emailoptinform" src="media/bf00553b.emailoptinform.png" data-original-source="https://i0.wp.com/www.nichepursuits.com/wp-content/uploads/2013/04/emailoptinform.png" width="545" height="613" /></a></p>
<p>In addition, I plan on adding a Twitter page to gain some more followers.  Thanks to a strategy that I was recently reminded of by <a href="http://podcastanswerman.com/">Cliff Ravenscraft of PodcastAnswerMan.com</a>, I should be able to gain a decent following without too much work. Cliff discussed this strategy at the <a href="http://www.socialmediaexaminer.com/smmworld/">Social Media Marketing World conference</a> which I attended last week in San Diego, CA.</p>
<p>In a nutshell, I am going to <a href="http://www.nichepursuits.com/tweetadder" target="_blank">use Tweet Adder to automatically follow people on Twitter</a> that are interested in the survival niche.  Tweet Adder is a tool that I have used in the past, and to be honest, works pretty well.  When you follow people, many of those people will follow you back.  So, if you follow enough people, you can build up a decent following.</p>
<p>This is how I gained an initial following on my Twitter page for NichePursuits.com, <a href="http://www.nichepursuits.com/tweetadder">I used Tweet Adder</a>.</p>
<p>I have nothing to lose by doing this with my survival knife site since I have NO Twitter following right now.  I’ll provide updates on this once I get started.</p>
<h3>Your Thoughts</h3>
<p>Overall, the state of SEO is very good.  I’m doing well with my niche websites, and other companies including Demand Media are achieving record profits.</p>
<p>I’ve shared what’s working for my niche site and what my plans are for the future.  The podcast below has even a few more details that I couldn’t cover in the text here.</p>
<p>I would love to hear any comments or questions that you have below!</p>
<p>You can <a href="https://itunes.apple.com/us/podcast/niche-pursuits-podcast/id522458761" target="_blank">listen to the podcast on iTunes right here</a>.</p>
<h3>Click Play to Listen to the Podcast!</h3>
<p>Podcast: <a title="Play in new window" href="media/36e52108.nichesiteproject.mp3" data-original-source="http://traffic.libsyn.com/nichepursuits/nichesiteproject.mp3" target="_blank" rel="nofollow">Play in new window</a> | <a title="Download" href="media/36e52108.nichesiteproject.mp3" data-original-source="http://traffic.libsyn.com/nichepursuits/nichesiteproject.mp3" rel="nofollow">Download</a></p>
</div>
</div>
</div><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benimarine.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benimarine.wordpress.com/18/" /></a> <img alt="" border="0" src="https://pixel.wp.com/b.gif?host=benimarine.wordpress.com&#038;blog=19488602&#038;post=18&#038;subd=benimarine&#038;ref=&#038;feed=1" width="1" height="1" />


feed_id: http://benimarine.wordpress.com/?p=15
title: 38 Free WordPress Themes for Niche Websites
uri: 38-Free-WordPress-Themes-for-Niche-Websites
url: https://benimarine.wordpress.com/2013/06/08/38-free-wordpress-themes-for-niche-websites/
content:
<p>&nbsp;</p>
<div id="inner-content">
<div class="post-1074 post type-post status-publish format-standard hentry category-niche-business-ideas category-niche-websites tag-adsense-themes tag-best-wordpress-themes tag-free-wordpress-themes tag-themes-for-niche-sites post cat-6-id cat-35-id" id="post-1074">
<h3><a title="38 Free WordPress Themes for Niche Websites" href="http://www.nichepursuits.com/38-free-wordpress-themes-for-niche-websites/" rel="bookmark"> </a></h3>
<div class="meta single"></div>
<div id="single"><a title="38 Free WordPress Themes for Niche Websites" href="media/e8447a44.iblog3.png" data-original-source="http://www.nichepursuits.com/wp-content/uploads/2011/12/iblog3.png" rel="lightbox"><img class="left single" title="38 Free WordPress Themes for Niche Websites" alt="38 Free WordPress Themes for Niche Websites" src="http://www.nichepursuits.com/wp-content/themes/download/einat/timthumb.php?src=https://i0.wp.com/www.nichepursuits.com/wp-content/uploads/2011/12/iblog3.png&amp;h=150&amp;w=150&amp;zc=1" width="150" height="150" /></a>What’s the best WordPress Theme to use for niche Adsense sites?  Is there one theme that should be used all the time?  Or should a new theme be used for each site? These are some of the questions that you should consider when building sites.  If you are only building one or two larger sites, then this is really not an issue.  You just find a great looking theme for your site and go for it!</p>
<p>However, if you are going to be building dozens of small niche sites, in my opinion you will want to use different looking themes for nearly all your sites.  The reason?  Manual reviews.  If for any reason Google decides to manually review your sites, you don’t want to get caught with having every single one of your sites looking exactly the same.  If nothing looks unique or original on your sites, then this will raise a big red flag to a manual reviewer.  Of course, we never know exactly what the Google algorithm or manual reviewers are going to do when they visit our sites, so I believe its best to keep each site looking as unique as possible.</p>
<p>I personally started out building lots of small niche sites about 2 years ago (I built several other larger sites before that were complete flops).  When I was building those sites, I used the exact same theme on all of them.  All of my sites looked exactly the same with the same theme, same ad layouts, colors, and everything.  Since that time, I’m pretty sure these sites were manually reviewed (can you ever know for sure?), penalized, and I had other tough learning experiences.  I went on from those experiences to build more unique sites and produced better content, and as a result <a href="http://www.nichepursuits.com/category/my-earnings/" target="_blank">my Google Adsense earnings</a> have surpassed what they were before these “tough” experiences.</p>
<p>So, I have some background when I state that you want to try to make each site as unique as possible.  Yes, its a little more work, but I believe its worth it.  Now when I build my sites, I do my best to use a different theme on each site.  I certainly have some repeats of themes that I really like; however, I do my best to switch it up.  Here are a list of both free and paid themes that I have used in the past for my niche websites.</p>
<h3><span style="color:#3366ff;">38 Free Themes for Niche Websites</span></h3>
<p>1. <a href="http://tips-and-template-for-blogger.blogspot.com/2011/05/bluesense-template-adsense-ready.html">Bluesense</a> – This and Prosense are the 2 themes that I used on all of my sites initially.  Bluesense produces the best Click Through Rate I have ever seen.  However, lots of these sites got penalized.  I don’t think it was Bluesense per se that caused it, but the fact that I used the same theme (could have been any theme?) on all my sites. I don’t use these themes on new sites now.</p>
<p>2. <a href="http://tips-and-template-for-blogger.blogspot.com/2011/05/prosense-grey-blogger-template-adsense.html">Prosense Grey</a> – Another free theme by DoshDosh, like Bluesense.  (Please note that <a href="http://www.doshdosh.com">DoshDosh.com</a> no longer appears to be a working site [which is really sad because it was an excellent blog] so these themes will not be up to date).</p>
<p>3. <a href="http://cordobo.com/free-wordpress-templates/green-park-2/">Green Park 2 by Cordobo.com</a></p>
<p>4. <a href="http://wordpress.org/extend/themes/darkzen">DarkZen by DailyBlogTips</a></p>
<p>5. <a href="http://wordpress.org/extend/themes/ifeature" target="_blank">iFeature theme</a></p>
<p>6. <a href="http://wordpress.org/extend/themes/istudio-theme" target="_blank">iStudio theme</a></p>
<p>7.<a href="http://wordpress.org/extend/themes/platform" target="_blank"> Platform theme</a></p>
<p>8. <a href="http://wordpress.org/extend/themes/zbench" target="_blank">zBench theme</a></p>
<p>9. <a href="http://wordpress.org/extend/themes/evolve" target="_blank">EvoLve Theme</a></p>
<p>10. <a href="http://wordpress.org/extend/themes/arjuna-x" target="_blank">Arjuna X theme</a></p>
<p>11. <a href="http://wordpress.org/extend/themes/light-and-modern" target="_blank">Light and Modern Theme</a></p>
<p>12. <a href="http://themezee.com/zeedisplay/" target="_blank">zeeDisplay Theme by ThemeZee.com</a></p>
<p>13. <a href="http://wordpress.org/extend/themes/baza-noclegowa" target="_blank">Baza Noclegowa Theme </a></p>
<p>14. <a href="http://wordpress.org/extend/themes/light-clean-blue" target="_blank">Light Clean Blue Theme</a></p>
<p>15. <a href="http://kovshenin.com/wordpress/themes/minimal-georgia/" target="_blank">Minimal Georgia Theme</a></p>
<p>16. <a href="http://wordpress.org/extend/themes/mflat" target="_blank">Mflat theme</a></p>
<p>17. <a href="http://wordpress.org/extend/themes/magazine-basic" target="_blank">Magazine Basic Theme</a></p>
<p>18 – 30. <a href="http://fthemes.com/" target="_blank">Fthemes.com</a> – I have probably used over a dozen free themes from this site.  The only downside is they require links in the footer to their sites, the theme will be disabled if you mess with the links.  Or you can pay $19 to buy the theme without the links.</p>
<p>31. <a href="http://wordpress.org/extend/themes/application" target="_blank">Application Theme</a></p>
<p>32. <a href="http://www.speckygeek.com/jenny-free-wordpress-theme/" target="_blank">Jenny Theme by SpeckyGeek.com</a></p>
<p>33.<a href="http://wordpress.org/extend/themes/iblog" target="_blank"> iBlog Theme</a></p>
<p>34. <a href="http://wordpress.org/extend/themes/whitehouse" target="_blank">Whitehouse Theme</a></p>
<p>35. <a href="http://wordpress.org/extend/themes/intrepidity" target="_blank">Intrepidity Theme</a></p>
<p>36. <a href="http://wordpress.org/extend/themes/magnolia" target="_blank">Magnolia Theme</a></p>
<p>37. <a href="http://www.blogperfume.com/silveray-clean-and-soft-3-column-wordpress-theme/" target="_blank">SilverRay by BlogPerfume.com</a></p>
<p>38. <a href="http://www.woothemes.com/2007/11/premiumnews/" target="_blank">Original Premium News by WooThemes</a></p>
<h3><span style="color:#3366ff;">Premium Themes (Not free)</span></h3>
<p>39.<a href="http://colorlabsproject.com/themes/arthemia-premium/" target="_blank"> Arthemia by Color Labs</a></p>
<p>40. <a href="http://www.elegantthemes.com/gallery/polished/" target="_blank">Polished theme by Elegant Themes</a></p>
<p>41. <a href="http://www.elegantthemes.com/gallery/coldstone/" target="_blank">Coldstone theme by Elegant Themes</a></p>
<p>42. <a href="http://themeforest.net" target="_blank">ThemeForest.com</a> – I have purchased a few premium themes from Theme Forest (including the one for the NichePursuits blog!); so there are lots of good options here for those sites you want a real eye catching design for.</p>
</div>
</div>
</div><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benimarine.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benimarine.wordpress.com/15/" /></a> <img alt="" border="0" src="https://pixel.wp.com/b.gif?host=benimarine.wordpress.com&#038;blog=19488602&#038;post=15&#038;subd=benimarine&#038;ref=&#038;feed=1" width="1" height="1" />


feed_id: http://benimarine.wordpress.com/?p=12
title: Execute PHP in WordPress post, page and Widget Sidebar
uri: Execute-PHP-in-WordPress-post-page-and-Widget-Sidebar
url: https://benimarine.wordpress.com/2013/06/08/execute-php-in-wordpress-post-page-and-widget-sidebar/
content:
<h1></h1>
<p><img alt="" src="media/0dbebc6c.phpwidget.gif" data-original-source="https://i0.wp.com/www.hongkiat.com/blog/wp-content/uploads/phpwidget.gif" /></p>
<p>If you are still struggling on how to insert PHP Codes inside particular blog post, page or a widget sidebar for execution; the following tutorial is for you.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3><strong>Executing PHP codes in WordPress Page/Post</strong></h3>
<p>&nbsp;</p>
<h4><strong>Installation</strong></h4>
<p>&nbsp;</p>
<ol>
<li>Download <a title="execute php codes in wordpress" href="http://priyadi.net/wp-content/plugins/phpexec.txt">phpexec.txt</a></li>
<li>Rename <em>phpexec.txt</em> to <em>phpexec.php</em></li>
<li>Upload to /wp-content/plugins/ directory</li>
<li>Activate the plug-in from WordPress administration menu</li>
</ol>
<p>&nbsp;</p>
<h4><strong>Usage</strong></h4>
<p>&nbsp;</p>
<p>Anywhere in your post/pages where you want to execute a PHP Codes, insert <em>&lt;phpcode&gt;</em> before your php codes and <em>&lt;/phpcode&gt;</em> your php codes.</p>
<p>&nbsp;</p>
<div class="dp-highlighter">
<div class="bar">
<div class="tools"><a href="http://www.hongkiat.com/blog/execute-php-in-wordpress-post-page-and-widget-sidebar/#">view plain</a><a href="http://www.hongkiat.com/blog/execute-php-in-wordpress-post-page-and-widget-sidebar/#">copy to clipboard</a><a href="http://www.hongkiat.com/blog/execute-php-in-wordpress-post-page-and-widget-sidebar/#">print</a><a href="http://www.hongkiat.com/blog/execute-php-in-wordpress-post-page-and-widget-sidebar/#">?</a></div>
</div>
<ol class="dp-c" start="1">
<li class="alt">&lt;phpcode&gt;</li>
<li>    &lt;?php</li>
<li class="alt">        <span class="func">echo</span> <span class="string">&#8220;Current date and time: &#8220;</span>;</li>
<li>        <span class="func">echo</span> <span class="func">date</span>(<span class="string">&#8220;l dS of F Y h:i:s A&#8221;</span>);</li>
<li class="alt">    ?&gt;</li>
<li>&lt;/phpcode&gt;</li>
</ol>
</div>
<p>&nbsp;</p>
<h4><strong>Security</strong></h4>
<p>&nbsp;</p>
<p>If you are running a blog with multiple users, you need to determine who can run this plug-in. Alter the settings in your Administration Menu. <em>Options -&gt; PHPExec</em></p>
<p>&nbsp;</p>
<h3><strong>Executing PHP codes in WordPress widget sidebar</strong></h3>
<p>&nbsp;</p>
<h4><strong>Installation</strong></h4>
<p>&nbsp;</p>
<ol>
<li><strong><a href="http://downloads.wordpress.org/plugin/php-code-widget.2.1.zip">Download</a></strong> the plugin.</li>
<li>Rename execphp.txt to execphp.php</li>
<li>Upload to /wp-content/plugins/ directory</li>
<li>Activate the plug-in from WordPress administration menu</li>
</ol>
<p>&nbsp;</p>
<h4><strong>Usage</strong></h4>
<p>&nbsp;</p>
<p>This plug-in work like a normal text widget except that it allows execution of PHP Codes. You can create up to 9 instances of this widget. <img alt="" src="media/9b4c0a45.phpwidget.jpg" data-original-source="https://i0.wp.com/www.hongkiat.com/blog/wp-content/uploads/phpwidget.jpg" /></p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benimarine.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benimarine.wordpress.com/12/" /></a> <img alt="" border="0" src="https://pixel.wp.com/b.gif?host=benimarine.wordpress.com&#038;blog=19488602&#038;post=12&#038;subd=benimarine&#038;ref=&#038;feed=1" width="1" height="1" />


feed_id: http://benimarine.wordpress.com/?p=10
title: Posting Source Code
uri: Posting-Source-Code
url: https://benimarine.wordpress.com/2013/06/08/posting-source-code/
content:
<p>While WordPress.com doesn’t allow you to use potentially dangerous code on your blog, there is a way to post source code for viewing. We have created a shortcode you can wrap around source code that preserves its formatting and even provides syntax highlighting for certain languages, like so:</p>
<p>&nbsp;</p>
<div style="width:300px !important;">
<div>
<div class="syntaxhighlighter  css" id="highlighter_418654">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="gutter">
<div class="line number1 index0 alt2">1</div>
<div class="line number2 index1 alt1">2</div>
<div class="line number3 index2 alt2">3</div>
<div class="line number4 index3 alt1">4</div>
</td>
<td class="code">
<div class="container">
<div class="line number1 index0 alt2"><code class="css plain">#button {</code></div>
<div class="line number2 index1 alt1"><code class="css spaces">    </code><code class="css keyword">font-weight</code><code class="css plain">: </code><code class="css value">bold</code><code class="css plain">;</code></div>
<div class="line number3 index2 alt2"><code class="css spaces">    </code><code class="css keyword">border</code><code class="css plain">: </code><code class="css value">2px</code> <code class="css value">solid</code> <code class="css value">#fff</code><code class="css plain">;</code></div>
<div class="line number4 index3 alt1"><code class="css plain">}</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>&nbsp;</p>
<p>To accomplish the above, just wrap your code in these tags:</p>
<p>&nbsp;</p>
<p><code>
<pre class="brush: css; title: ; notranslate">
 your code here
 </pre>
<p></code></p>
<p>&nbsp;</p>
<p>The <code>language</code> (or <code>lang</code>) parameter controls how the code is syntax highlighted. The following languages are supported:</p>
<p>&nbsp;</p>
<ul>
<li>actionscript3</li>
<li>bash</li>
<li>clojure</li>
<li>coldfusion</li>
<li>cpp</li>
<li>csharp</li>
<li>css</li>
<li>delphi</li>
<li>erlang</li>
<li>fsharp</li>
<li>diff</li>
<li>groovy</li>
<li>html</li>
<li>javascript</li>
<li>java</li>
<li>javafx</li>
<li>matlab (keywords only)</li>
<li>objc</li>
<li>perl</li>
<li>php</li>
<li>text</li>
<li>powershell</li>
<li>python</li>
<li>r</li>
<li>ruby</li>
<li>scala</li>
<li>sql</li>
<li>vb</li>
<li>xml</li>
</ul>
<p>&nbsp;</p>
<p>If the language parameter is not set, it will default to &#8220;text&#8221; (no syntax highlighting).</p>
<p>&nbsp;</p>
<p>Code in between the source code tags will automatically be encoded for display, you don&#8217;t need to worry about HTML entities or anything.</p>
<p>&nbsp;</p>
<h4 class="section-title" id="configuration-parameters">Configuration Parameters</h4>
<p>&nbsp;</p>
<p>The shortcodes also accept a variety of configuration parameters that you may use to customize the output. All are completely optional.</p>
<p>&nbsp;</p>
<ul>
<li><code>autolinks</code> (true/false) &#8212; Makes all URLs in your posted code clickable. Defaults to true.</li>
<li><code>collapse</code> (true/false) &#8212; If true, the code box will be collapsed when the page loads, requiring the visitor to click to expand it. Good for large code posts. Defaults to false.</li>
<li><code>firstline</code> (number) &#8212; Use this to change what number the line numbering starts at. It defaults to 1.</li>
<li><code>gutter</code> (true/false) &#8212; If false, the line numbering on the left side will be hidden. Defaults to true.</li>
<li><code>highlight</code> (comma-seperated list of numbers) &#8212; You can list the line numbers you want to be highlighted. For example &#8220;4,7,19&#8221;.</li>
<li><code>htmlscript</code> (true/false) &#8212; If true, any HTML/XML in your code will be highlighted. This is useful when you are mixing code into HTML, such as PHP inside of HTML. Defaults to false and will only work with certain code languages.</li>
<li><code>light</code> (true/false) &#8212; If true, the gutter (line numbering) and toolbar (see below) will be hidden. This is helpful when posting only one or two lines of code. Defaults to false.</li>
<li><code>padlinenumbers</code> (true/false/integer) &#8212; Allows you to control the line number padding. <code>true</code> will result in automatic padding, <code>false</code> will result in no padding, and entering a number will force a specific amount of padding.</li>
<li><code>title</code> (string) &#8212; Set a label for your code block. Can be useful when combined with the <code>collapse</code> parameter.</li>
</ul>
<p>&nbsp;</p>
<p>Here&#8217;s some examples of the above parameters in action:</p>
<p>&nbsp;</p>
<div>
<div class="syntaxhighlighter  plain" id="highlighter_332636">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="gutter">
<div class="line number8 index0 alt1">8</div>
<div class="line number9 index1 alt2 highlighted">9</div>
<div class="line number10 index2 alt1 highlighted">10</div>
<div class="line number11 index3 alt2">11</div>
</td>
<td class="code">
<div class="container">
<div class="line number8 index0 alt1"><code class="plain plain">This line is not highlighted.</code></div>
<div class="line number9 index1 alt2 highlighted"><code class="plain plain">This line is highlighted.</code></div>
<div class="line number10 index2 alt1 highlighted"><code class="plain plain">This line is highlighted.</code></div>
<div class="line number11 index3 alt2"><code class="plain plain">This line is not highlighted.</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div>
<div class="syntaxhighlighter  xml" id="highlighter_210193">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="gutter">
<div class="line number1 index0 alt2">0001</div>
</td>
<td class="code">
<div class="container">
<div class="line number1 index0 alt2"><code class="xml plain">&lt;</code><code class="xml keyword">strong</code><code class="xml plain">&gt;This&lt;/</code><code class="xml keyword">strong</code><code class="xml plain">&gt; is a short snippit of &lt;</code><code class="xml keyword">code</code><code class="xml plain">&gt;code&lt;/</code><code class="xml keyword">code</code><code class="xml plain">&gt; with padlinenumbers set to 4.</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>&nbsp;</p>
<p>And here&#8217;s a larger code block to see it all in action. It is set to the PHP language with &#8220;htmlscript&#8221; enabled and line number 12 highlighted.</p>
<p>&nbsp;</p>
<div>
<div class="syntaxhighlighter  htmlscript" id="highlighter_146792">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="gutter">
<div class="line number1 index0 alt2">1</div>
<div class="line number2 index1 alt1">2</div>
<div class="line number3 index2 alt2">3</div>
<div class="line number4 index3 alt1">4</div>
<div class="line number5 index4 alt2">5</div>
<div class="line number6 index5 alt1">6</div>
<div class="line number7 index6 alt2">7</div>
<div class="line number8 index7 alt1">8</div>
<div class="line number9 index8 alt2">9</div>
<div class="line number10 index9 alt1">10</div>
<div class="line number11 index10 alt2">11</div>
<div class="line number12 index11 alt1 highlighted">12</div>
<div class="line number13 index12 alt2">13</div>
<div class="line number14 index13 alt1">14</div>
<div class="line number15 index14 alt2">15</div>
<div class="line number16 index15 alt1">16</div>
<div class="line number17 index16 alt2">17</div>
<div class="line number18 index17 alt1">18</div>
<div class="line number19 index18 alt2">19</div>
<div class="line number20 index19 alt1">20</div>
<div class="line number21 index20 alt2">21</div>
<div class="line number22 index21 alt1">22</div>
<div class="line number23 index22 alt2">23</div>
<div class="line number24 index23 alt1">24</div>
</td>
<td class="code">
<div class="container">
<div class="line number1 index0 alt2"><code class="htmlscript plain">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a>"&gt;</code></div>
<div class="line number2 index1 alt1"><code class="htmlscript plain">&lt;</code><code class="htmlscript keyword">html</code> <code class="htmlscript color1">xmlns</code><code class="htmlscript plain">=</code><code class="htmlscript string">"<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>"</code> <code class="htmlscript color1">xml:lang</code><code class="htmlscript plain">=</code><code class="htmlscript string">"en"</code> <code class="htmlscript color1">lang</code><code class="htmlscript plain">=</code><code class="htmlscript string">"en"</code><code class="htmlscript plain">&gt;</code></div>
<div class="line number3 index2 alt2"><code class="htmlscript plain">&lt;</code><code class="htmlscript keyword">head</code><code class="htmlscript plain">&gt;</code></div>
<div class="line number4 index3 alt1"><code class="htmlscript spaces">    </code><code class="htmlscript plain">&lt;</code><code class="htmlscript keyword">meta</code> <code class="htmlscript color1">http-equiv</code><code class="htmlscript plain">=</code><code class="htmlscript string">"Content-Type"</code> <code class="htmlscript color1">content</code><code class="htmlscript plain">=</code><code class="htmlscript string">"text/html; charset=UTF-8"</code> <code class="htmlscript plain">/&gt;</code></div>
<div class="line number5 index4 alt2"><code class="htmlscript spaces">    </code><code class="htmlscript plain">&lt;</code><code class="htmlscript keyword">title</code><code class="htmlscript plain">&gt;WordPress.com Code Example&lt;/</code><code class="htmlscript keyword">title</code><code class="htmlscript plain">&gt;</code></div>
<div class="line number6 index5 alt1"><code class="htmlscript plain">&lt;/</code><code class="htmlscript keyword">head</code><code class="htmlscript plain">&gt;</code></div>
<div class="line number7 index6 alt2"><code class="htmlscript plain">&lt;</code><code class="htmlscript keyword">body</code><code class="htmlscript plain">&gt;</code></div>
<div class="line number8 index7 alt1"><code class="htmlscript spaces">    </code><code class="htmlscript plain">&lt;</code><code class="htmlscript keyword">h1</code><code class="htmlscript plain">&gt;WordPress.com Code Example&lt;/</code><code class="htmlscript keyword">h1</code><code class="htmlscript plain">&gt;</code></div>
<div class="line number9 index8 alt2"></div>
<div class="line number10 index9 alt1"><code class="htmlscript spaces">    </code><code class="htmlscript plain">&lt;</code><code class="htmlscript keyword">p</code><code class="php plain">&gt;</code><code class="php script">&lt;?</code><code class="htmlscript keyword">php</code> <code class="php functions">echo</code> <code class="php string">'Hello World!'</code><code class="php plain">; </code><code class="php script">?&gt;</code><code class="htmlscript plain">&lt;/</code><code class="htmlscript keyword">p</code><code class="htmlscript plain">&gt;</code></div>
<div class="line number11 index10 alt2"></div>
<div class="line number12 index11 alt1 highlighted"><code class="htmlscript spaces">    </code><code class="htmlscript plain">&lt;</code><code class="htmlscript keyword">p</code><code class="htmlscript plain">&gt;This line is highlighted.&lt;/</code><code class="htmlscript keyword">p</code><code class="htmlscript plain">&gt;</code></div>
<div class="line number13 index12 alt2"></div>
<div class="line number14 index13 alt1"><code class="htmlscript spaces">    </code><code class="htmlscript plain">&lt;</code><code class="htmlscript keyword">p</code><code class="htmlscript plain">&gt;This line is very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long.&lt;/</code><code class="htmlscript keyword">p</code><code class="htmlscript plain">&gt;</code></div>
<div class="line number15 index14 alt2"></div>
<div class="line number16 index15 alt1"><code class="htmlscript spaces">    </code><code class="htmlscript plain">&lt;</code><code class="htmlscript keyword">div</code> <code class="htmlscript color1">class</code><code class="htmlscript plain">=</code><code class="htmlscript string">"foobar"</code><code class="htmlscript plain">&gt;</code></div>
<div class="line number17 index16 alt2"><code class="htmlscript spaces">        </code><code class="htmlscript plain">This    is  an</code></div>
<div class="line number18 index17 alt1"><code class="htmlscript spaces">        </code><code class="htmlscript plain">example of  smart</code></div>
<div class="line number19 index18 alt2"><code class="htmlscript spaces">        </code><code class="htmlscript plain">tabs.</code></div>
<div class="line number20 index19 alt1"><code class="htmlscript spaces">    </code><code class="htmlscript plain">&lt;/</code><code class="htmlscript keyword">div</code><code class="htmlscript plain">&gt;</code></div>
<div class="line number21 index20 alt2"></div>
<div class="line number22 index21 alt1"><code class="htmlscript spaces">    </code><code class="htmlscript plain">&lt;</code><code class="htmlscript keyword">p</code><code class="htmlscript plain">&gt;&lt;</code><code class="htmlscript keyword">a</code> <code class="htmlscript color1">href</code><code class="htmlscript plain">=</code><code class="htmlscript string">"<a href="http://wordpress.com/">http://wordpress.com/</a>"</code><code class="htmlscript plain">&gt;WordPress.com&lt;/</code><code class="htmlscript keyword">a</code><code class="htmlscript plain">&gt;&lt;/</code><code class="htmlscript keyword">p</code><code class="htmlscript plain">&gt;</code></div>
<div class="line number23 index22 alt2"><code class="htmlscript plain">&lt;/</code><code class="htmlscript keyword">body</code><code class="htmlscript plain">&gt;</code></div>
<div class="line number24 index23 alt1"><code class="htmlscript plain">&lt;/</code><code class="htmlscript keyword">html</code><code class="htmlscript plain">&gt;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benimarine.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benimarine.wordpress.com/10/" /></a> <img alt="" border="0" src="https://pixel.wp.com/b.gif?host=benimarine.wordpress.com&#038;blog=19488602&#038;post=10&#038;subd=benimarine&#038;ref=&#038;feed=1" width="1" height="1" />


feed_id: http://benimarine.wordpress.com/?p=8
title: Enables superusers to copy existing sub blogs to new sub blogs.
uri: Enables-superusers-to-copy-existing-sub-blogs-to-new-sub-blogs
url:
https://benimarine.wordpress.com/2013/06/08/enables-superusers-to-copy-existing-sub-blogs-to-new-sub-blogs/

content:
<p>A simple and effective approach to copying blogs within a multisite network.</p>
<ul>
<li>Copy a blog including all its widgets, template settings and more.</li>
<li>Option to copy or not copy files.</li>
<li>GUIDs and urls in post contents are migrated automatically.</li>
</ul>
<p>This plugin was derived from Ron Renneck&#8217;s awesome WP Replicator (<a href="http://wpebooks.com/replicator/" rel="nofollow">http://wpebooks.com/replicator/</a>) plugin, although it&#8217;s been 90% rewritten. Changes from the original include the following:</p>
<ul>
<li>Improved performance on large scale blogs.</li>
<li>Improved file copy performance and an option in the admin to bypass copying altogether.</li>
<li>Removed limit of number of blogs that can be used as a copy source.</li>
<li>Encapsulated the code in a Class and renamed variables to be more readable.</li>
<li>Revised UI to keep it simple and easy to use.</li>
</ul>
<p>Sadly the WordPress file management code is not idea for handling the copying of a large folder with subdirectories so we opted to stick with exec(&#8216;cp&#8217;). On the flip side, we set up a filter (copy_blog_files_command) so that you can override it with your own custom copy code.</p>
<p>This plugin is actively supported and we will do our best to help you. In return we simply as 3 things:</p>
<ol>
<li>Help Out. If you see a question on the forum you can help with or have a great idea and want to code it up and submit a patch, that would be just plain awesome and we will shower your with praise. Might even be a good way to get to know us and lead to some paid work if you freelance. Also, we are happy to post translations if you provide them.</li>
<li>Donate &#8211; if this is generating enough revenue to support our time it makes all the difference in the world <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=TWM2GF6BQZGSN" rel="nofollow">https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=TWM2GF6BQZGSN</a></li>
<li>Support us by buying our Premium plugins. In particular, check out our Events Calendar Pro <a href="http://tri.be/wordpress-events-calendar-pro/" rel="nofollow">http://tri.be/wordpress-events-calendar-pro/</a></li>
</ol><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benimarine.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benimarine.wordpress.com/8/" /></a> <img alt="" border="0" src="https://pixel.wp.com/b.gif?host=benimarine.wordpress.com&#038;blog=19488602&#038;post=8&#038;subd=benimarine&#038;ref=&#038;feed=1" width="1" height="1" />


