<?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>J3 Web Works</title>
	<atom:link href="http://j3webworks.com/feed" rel="self" type="application/rss+xml" />
	<link>http://j3webworks.com</link>
	<description>Web Design and Blog Consulting</description>
	<lastBuildDate>Thu, 01 Sep 2011 14:50:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>WordPress custom taxonomy conditional tag</title>
		<link>http://j3webworks.com/blog/wordpress-custom-taxonomy-conditional</link>
		<comments>http://j3webworks.com/blog/wordpress-custom-taxonomy-conditional#comments</comments>
		<pubDate>Thu, 23 Jun 2011 02:56:13 +0000</pubDate>
		<dc:creator>forlogos</dc:creator>
				<category><![CDATA[hack]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://j3webworks.com/?p=533</guid>
		<description><![CDATA[For a particular project, I needed WordPress to do something based on a custom post type&#8217;s custom taxonomy. WP didn&#8217;t have a built in function for checking custom taxonomies so I googled for an answer. After looking for ways to have WordPress do a conditional test for custom taxonomies I was unsatisfied with what I [...]]]></description>
			<content:encoded><![CDATA[<p>For a particular project, I needed WordPress to do something based on a custom post type&#8217;s custom taxonomy. WP didn&#8217;t have a built in function for checking custom taxonomies so I googled for an answer.</p>
<p>After looking for ways to have WordPress do a conditional test for custom taxonomies I was unsatisfied with what I found since most of the solutions involved making functions. While they do work, it was a bit too much for my use  since I really only needed to check the custom post against only one custom taxonomy. And mostly because I know that there is always more than one way to skin a cat&#8230; and sometimes I really do want to find &#8220;<em>my own solution</em>&#8220;.</p>
<p>So here&#8217;s my version of the one-time, non-function way to test for a conditional taxonomy on a conditional post type, which admittedly may not be so efficient, but it works! (and if you cache, then it doesn&#8217;t really matter)  First, you need to put this bit of PHP somewhere before where you need to do your conditional test:</p>
<pre class="brush: php">
&lt;?php
$tempvar = urldecode(http_build_query(get_the_terms($post-&gt;id, &#039;custom_tax_name&#039;)));
if(strpos($tempvar, &#039;[term_taxonomy_id]=101&#039;) !== false) {$customtaxis = &#039;y&#039;;}else{$customtaxis = &#039;n&#039;;}
?&gt;
</pre>
<p>Line 2 puts all the post&#8217;s taxonomy information as a string into the $tempvar variable. Line 3 checks whether the a taxonomy with ID of 101 is in $tempvar and sets the $customtaxis variable appropriately.</p>
<p>To make this work for you change the following :</p>
<ul>
<li><strong>custom_tax_name</strong> to the name of your custom taxonomy (the $taxonomy variable in the <a href="http://codex.wordpress.org/Function_Reference/register_taxonomy" target="blank">register_taxonomy function</a>)</li>
<li><strong>101</strong> to the ID of the custom taxonomy you want to test</li>
<li><strong>$tempvar</strong> and <strong>$customtaxis</strong> to whatever variables you want, if you want</li>
</ul>
<p>Then, where ever you want to test for your custom taxonomy, use this:</p>
<pre class="brush: php">
if($customtaxis  == &#039;y&#039;) {
// if yes, whatever you want
}else{
// if not, whatever you want
}
</pre>
<p>And that&#8217;s it!</p>
<p>Note: This must be used inside the loop. Tested in WP version 3.1 &#8211; 3.1.3</p>
]]></content:encoded>
			<wfw:commentRss>http://j3webworks.com/blog/wordpress-custom-taxonomy-conditional/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 3.1 released &#8211; my favorite fix is&#8230;</title>
		<link>http://j3webworks.com/blog/wordpress-3-1-favorite-fix</link>
		<comments>http://j3webworks.com/blog/wordpress-3-1-favorite-fix#comments</comments>
		<pubDate>Thu, 24 Feb 2011 02:30:32 +0000</pubDate>
		<dc:creator>forlogos</dc:creator>
				<category><![CDATA[comments]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://j3webworks.com/?p=504</guid>
		<description><![CDATA[WordPress version 3.1 has just been released. Yeah!!!! I&#8217;ve only been excited about one other WP release, which was for 3.0&#8242;s custom post types (now one of my favorite features to use in WordPress). So, why am I so excited about 3.1? Mostly because of one fix: The Password Reset Redux. This fix greatly simplifies [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wordpress.org/news/2011/02/threeone/">WordPress version 3.1</a> has just been released.  Yeah!!!!</p>
<p>I&#8217;ve only been excited about one other WP release, which was for 3.0&#8242;s custom post types (now one of my favorite features to use in WordPress).</p>
<p>So, why am I so excited about 3.1? Mostly because of one fix: The <a href="http://core.trac.wordpress.org/ticket/5919" target="blank">Password Reset Redux</a>.</p>
<p>This fix greatly simplifies the WP lost password process by replacing the two email process with a single email process.</p>
<p>So why would I be so happy about this?</p>
<p>At work I manage a membership only blog with (currently) a little over 2,000 members/users and I am <strong>tired</strong> of having to answer customer support emails from members that can&#8217;t figure out how to reset their passwords. A number of the site&#8217;s members experience <a href="http://www.urbandictionary.com/define.php?term=pebkac" target="blank">PEBKAC</a> errors because they either don&#8217;t understand the WP-generated passwords provided, they don&#8217;t read the emails carefully, they don&#8217;t wait to receive any email, or they just really are technologically challenged.</p>
<p>So, to the WordPress open source community, a big <strong>THANK YOU!!!!!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://j3webworks.com/blog/wordpress-3-1-favorite-fix/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress comments meta data: Adding a checkbox</title>
		<link>http://j3webworks.com/blog/wordpress-comments-meta-data-adding-a-checkbox</link>
		<comments>http://j3webworks.com/blog/wordpress-comments-meta-data-adding-a-checkbox#comments</comments>
		<pubDate>Mon, 28 Jun 2010 15:57:48 +0000</pubDate>
		<dc:creator>forlogos</dc:creator>
				<category><![CDATA[comments]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://j3webworks.com/?p=472</guid>
		<description><![CDATA[Recently at work, there was a need to ask for additional data in the comments section of a WordPress site. A checkbox needed to be added to the comments form asking a question. This sounded like a good use for WordPress comments meta data. There isn&#8217;t a lot of information out on the interwebs about [...]]]></description>
			<content:encoded><![CDATA[<p>Recently at work, there was a need to ask for additional data in the comments section of a WordPress site.  A checkbox needed to be added to the comments form asking a question.</p>
<p>This sounded like a good use for WordPress comments meta data.  There isn&#8217;t a lot of information out on the interwebs about how to use it, so I had to more or less figure this out&#8230;</p>
<p>So, what needed to be done was:</p>
<ul>
<li>add a check box to the comments form</li>
<li>show in the WordPress comments admin whether or not the checkbox was selected</li>
<li>indicate in the comment notification email whether or not the checkbox was selected</li>
</ul>
<p>Adding the checkbox to the comments form is the easiest part.  To add the checkbox to the comments form open up your themes comments.php file and paste this into the area where you need it:</p>
<pre class="brush: html">
&lt;p&gt;&lt;label&gt;&lt;input name=&quot;publishc&quot; type=&quot;checkbox&quot; id=&quot;publishc&quot; value=&quot;this is the value I want to capture&quot; tabindex=&quot;90&quot; /&gt; Whatever sentence that you want commenters to use the checkbox for&lt;/label&gt;&lt;/p&gt;
</pre>
<p>Now that the checkbox is in place, we need to make sure that the data (the checkbox value) is saved to the database.  We also want that data to be visible when viewing the comments from within the WordPress admin.  So, paste this in your theme&#8217;s functions.php file:</p>
<pre class="brush: php">
// allow the saving of comment meta data
function fpo_allow_show_comment ( $post_id ) {
$allow_show_comment = $_POST[&#039;publishc&#039;];
if ( $allow_show_comment ) {
add_comment_meta( $post_id, &#039;publishc&#039;, $allow_show_comment, true );
}}
add_action( &#039;comment_post&#039;, &#039;fpo_allow_show_comment&#039;, 1 );

// display meta in the edit comments admin page
function show_commeta() {
if (is_admin()) {
   echo get_comment_text(), &#039;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;&#039;, get_comment_meta(get_comment_ID(), &#039;publishc&#039;,1), &#039;&lt;strong&gt;&#039;;
   }}
add_action(&#039;comment_text&#039;, &#039;show_commeta&#039;);
</pre>
<p>The first function will allow comments meta data to be collected and to save it to the database.  The second functions will show it in the comments admin pages.</p>
<p>Adding the comments meta data to the notification email proved to be the hardest to figure out &#8211; I couldn&#8217;t figure out a way to do it via plugin or editing functions.php.  So, I decided to do this the least desirable way, which is to edit the WordPress core files, namely wp-includes/pluggable.php.</p>
<p>So find the function <strong>wp_notify_postauthor</strong> and look for the part that says <strong>if (&#8216;comment&#8217; == $comment_type) {</strong>.  Paste these lines of code in whatever area of the notification email where you would like the comment meta to be included:</p>
<pre class="brush: php">
$notify_message .= __(&#039;Comment meta: &#039;) ;
$notify_message .= sprintf( get_comment_meta($comment-&gt;comment_ID, &#039;publishc&#039;,1)) . &quot;\r\n\r\n&quot;;
</pre>
<p>And that is that, hours and hours worth of trial and error.  Hope you find it useful!</p>
<p><em>Test and works in WordPress versions 2.9 through 3.0.4.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://j3webworks.com/blog/wordpress-comments-meta-data-adding-a-checkbox/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WordPress: make posts expire or auto-delete</title>
		<link>http://j3webworks.com/blog/wordpress-make-posts-expire-or-auto-delete</link>
		<comments>http://j3webworks.com/blog/wordpress-make-posts-expire-or-auto-delete#comments</comments>
		<pubDate>Mon, 21 Jun 2010 22:58:48 +0000</pubDate>
		<dc:creator>forlogos</dc:creator>
				<category><![CDATA[hack]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://j3webworks.com/?p=456</guid>
		<description><![CDATA[While working on a website, the client needed the homepage to function differently from other websites and blogs. Rather than having the home page show the last x number of posts or editing the loop through query_posts to only show posts within a certain timeframe, the posts would either need to appear on the homepage [...]]]></description>
			<content:encoded><![CDATA[<p>While working on a website, the client needed the homepage to function differently from other websites and blogs.</p>
<p>Rather than having the home page show the last x number of posts or editing the loop through <strong>query_posts</strong> to only show posts within a certain timeframe, the posts would either need to appear on the homepage until:</p>
<ul>
<li>a specific date &#8211; and then the post will either be archived or deleted</li>
<li>or if no date is set, the post should appear for a month</li>
</ul>
<p>I knew that there was a way to makes posts &#8220;expire&#8221; by setting a date and time as a custom field and editing the loop.  A search on Google reveals several articles (all of which are identical &#8211; exactly the same, so I don&#8217;t know the original article which I could link to).  I then also found an article that edited the expire posts code so that the post would auto delete rather than expire: <a href="http://www.rockia.com/2010/01/modify-you-wordpress-theme-to-enable-an-expiration-for-your-posting" target="blank">Modify you WordPress theme to enable an expiration date for your posting</a>.</p>
<p>There a few drawbacks to the methods I found:</p>
<ul>
<li>they needed post custom fields, which aren&#8217;t the most user friendly interface for end users to employ</li>
<li>custom fields do not look nice</li>
<li>the custom field entry needed to be in the format <strong>mm/dd/yyyy 00:00:00</strong> not exactly user friendly nor easy to understand (is 17:00:00 7pm or 5pm??)</li>
<li>posts would either only expire (be archived) or be deleted</li>
</ul>
<p>So now I needed to put on my PHP hat and find a way to get what needed to be done and avoid the drawbacks listed above.  I knew right away that I would need to use custom write panels to make everything easy to look at and use.  I wrote about using them here, <a href="http://j3webworks.com/blog/wordpress-custom-write-panels-prioritizing-what-to-display">WordPress Custom Write Panels &#038; prioritizing what to display</a> and used this as my reference, <a href="http://wefunction.com/2009/10/revisited-creating-custom-write-panels-in-wordpress/" target="blank">Revisited: Creating Custom Write Panels in WordPress</a></p>
<p>In the end, this is what my WordPress custom write panel looked like:<br />
<img src="http://j3webworks.com/wp-content/uploads/WordPress-makes-posts-expire-or-auto-delete.jpg" alt="WordPress make posts expire or auto-delete"/></p>
<p>Obviously, this is for posts in the &#8220;announcements&#8221; category.  Anyway, open up your themes functions.php (or make one) and add this code in:</p>
<pre class="brush: php">
&lt;?php
//start  post meta box
$key = &quot;Announcements&quot;;
$meta_boxes = array(

&quot;expimo&quot; =&gt; array(
&quot;name&quot; =&gt; &quot;expimo&quot;,
&quot;title&quot; =&gt; &quot;Expiration Month&quot;,
&quot;description&quot; =&gt; &quot;Select a date in the future for this post to expire.  Default date is one month into the future&quot;,
&quot;option&quot; =&gt; array(&#039;01&#039;, &#039;02&#039;, &#039;03&#039;, &#039;04&#039;, &#039;05&#039;, &#039;06&#039;, &#039;07&#039;, &#039;08&#039;, &#039;09&#039;, &#039;10&#039;, &#039;11&#039;, &#039;12&#039;)),

&quot;expida&quot; =&gt; array(
&quot;name&quot; =&gt; &quot;expida&quot;,
&quot;title&quot; =&gt; &quot;Expiration Day&quot;,
&quot;description&quot; =&gt; &quot;Select Day&quot;,
&quot;options&quot; =&gt; array(&#039;-&#039;, &#039;01&#039;, &#039;02&#039;, &#039;03&#039;, &#039;04&#039;, &#039;05&#039;, &#039;06&#039;, &#039;07&#039;, &#039;08&#039;, &#039;09&#039;, &#039;10&#039;, &#039;11&#039;, &#039;12&#039;, &#039;13&#039;, &#039;14&#039;, &#039;15&#039;, &#039;16&#039;, &#039;17&#039;, &#039;18&#039;, &#039;19&#039;, &#039;20&#039;, &#039;21&#039;, &#039;22&#039;, &#039;23&#039;, &#039;24&#039;, &#039;25&#039;, &#039;26&#039;, &#039;27&#039;, &#039;28&#039;, &#039;29&#039;, &#039;30&#039;, &#039;31&#039;)),

&quot;expiye&quot; =&gt; array(
&quot;name&quot; =&gt; &quot;expiye&quot;,
&quot;title&quot; =&gt; &quot;Expiration Year&quot;,
&quot;description&quot; =&gt; &quot;Select Month&quot;,
&quot;options&quot; =&gt; array(&#039;-&#039;, &#039;2013&#039;, &#039;2012&#039;, &#039;2011&#039;, &#039;2010&#039;)),

&quot;expiti&quot; =&gt; array(
&quot;name&quot; =&gt; &quot;expiti&quot;,
&quot;title&quot; =&gt; &quot;Expiration Time&quot;,
&quot;description&quot; =&gt; &quot;Select Time&quot;,
&quot;options&quot; =&gt; array(&#039;00:00:00&#039;, &#039;01:00:00&#039;, &#039;02:00:00&#039;, &#039;03:00:00&#039;, &#039;04:00:00&#039;, &#039;05:00:00&#039;, &#039;06:00:00&#039;, &#039;07:00:00&#039;, &#039;08:00:00&#039;, &#039;09:00:00&#039;, &#039;10:00:00&#039;, &#039;11:00:00&#039;, &#039;12:00:00&#039;, &#039;13:00:00&#039;, &#039;14:00:00&#039;, &#039;15:00:00&#039;, &#039;16:00:00&#039;, &#039;17:00:00&#039;, &#039;18:00:00&#039;, &#039;19:00:00&#039;, &#039;20:00:00&#039;, &#039;21:00:00&#039;, &#039;22:00:00&#039;, &#039;23:00:00&#039;)),

&quot;autodelp&quot; =&gt; array(
&quot;name&quot; =&gt; &quot;autodelp&quot;,
&quot;title&quot; =&gt; &quot;Delete Post On Expiration&quot;,
&quot;description&quot; =&gt; &quot;Choose if a post should be deleted after expiration.  Choosing NO will remove the post from the homepage and archive it upon expiration&quot;,
&quot;options&quot; =&gt; array(&#039;no&#039;, &#039;yes&#039;)),

);

function create_meta_box() {
global $key;

if( function_exists( &#039;add_meta_box&#039; ) ) {
add_meta_box( &#039;new-meta-boxes&#039;, ucfirst( $key ) . &#039; Post Options&#039;, &#039;display_meta_box&#039;, &#039;post&#039;, &#039;normal&#039;, &#039;high&#039; );
}
}

function display_meta_box() {
global $post, $meta_boxes, $key;
?&gt;

&lt;div class=&quot;form-wrap&quot;&gt;

&lt;?php

wp_nonce_field( plugin_basename( __FILE__ ), $key . &#039;_wpnonce&#039;, false, true );

foreach($meta_boxes as $meta_box) {
$data = get_post_meta($post-&gt;ID, $key, true);

?&gt;
&lt;?php if($meta_box[ &#039;name&#039;] != &#039;expimo&#039; &amp;&amp;
         $meta_box[ &#039;name&#039;] != &#039;expida&#039; &amp;&amp;
         $meta_box[ &#039;name&#039;] != &#039;expiye&#039; &amp;&amp;
		 $meta_box[ &#039;name&#039;] != &#039;autodep&#039; &amp;&amp;
		 $meta_box[ &#039;name&#039;] != &#039;expiti&#039; &amp;&amp;
		 $meta_box[ &#039;name&#039;] != &#039;autodelp&#039;
) { ?&gt;
&lt;div class=&quot;form-field form-required&quot;&gt;

&lt;label for=&quot;&lt;?php echo $meta_box[ &#039;name&#039; ]; ?&gt;&quot;&gt;&lt;?php echo $meta_box[ &#039;title&#039; ]; ?&gt;&lt;/label&gt;

&lt;input type=&quot;text&quot; name=&quot;&lt;?php echo $meta_box[ &#039;name&#039; ]; ?&gt;&quot; value=&quot;&lt;?php echo htmlspecialchars( $data[ $meta_box[ &#039;name&#039; ] ] ); ?&gt;&quot; /&gt;  

&lt;p&gt;&lt;?php echo $meta_box[ &#039;description&#039; ]; ?&gt;&lt;/p&gt;&lt;/div&gt;
&lt;?php } elseif ($meta_box[ &#039;name&#039;] == &#039;expimo&#039;) {

echo &#039;&lt;div class=&quot;form-field form-required&quot;&gt;&lt;label for=&quot;Post Expiration Date&quot;&gt;Post Expiration Date&lt;/label&gt;&#039;;
echo &#039;&lt;select name=&quot;expimo&quot; id=&quot;expimo&quot;&gt;&#039;;
	foreach ($meta_boxes[&#039;expimo&#039;][&#039;option&#039;] as $option) {
	if ($option == &#039;01&#039;) {$optionez = &#039;January&#039;;
} elseif ($option == &#039;02&#039;) {$optionez = &#039;February&#039;;
} elseif ($option == &#039;03&#039;) {$optionez = &#039;March&#039;;
} elseif ($option == &#039;04&#039;) {$optionez = &#039;April&#039;;
} elseif ($option == &#039;05&#039;) {$optionez = &#039;May&#039;;
} elseif ($option == &#039;06&#039;) {$optionez = &#039;June&#039;;
} elseif ($option == &#039;07&#039;) {$optionez = &#039;July&#039;;
} elseif ($option == &#039;08&#039;) {$optionez = &#039;August&#039;;
} elseif ($option == &#039;09&#039;) {$optionez = &#039;September&#039;;
} elseif ($option == &#039;10&#039;) {$optionez = &#039;August&#039;;
} elseif ($option == &#039;11&#039;) {$optionez = &#039;November&#039;;
} else {$optionez = &#039;December&#039;;}
		echo &#039;&lt;option&#039;, &#039; value=&quot;&#039;, $option, &#039;&quot;&#039;, $data[ &#039;expimo&#039; ] == $option ? &#039; selected=&quot;selected&quot;&#039; : &#039;&#039;, &#039;&gt;&#039;, $optionez, &#039;&lt;/option&gt;&#039;;
                }
                echo &#039;&lt;/select&gt;&#039;;
echo &#039;&lt;select name=&quot;expida&quot; id=&quot;expida&quot;&gt;&#039;;
	foreach ($meta_boxes[&#039;expida&#039;][&#039;options&#039;] as $option) {
		echo &#039;&lt;option&#039;, &#039; value=&quot;&#039;, $option, &#039;&quot;&#039;, $data[ &#039;expida&#039; ] == $option ? &#039; selected=&quot;selected&quot;&#039; : &#039;&#039;, &#039;&gt;&#039;, $option, &#039;&lt;/option&gt;&#039;;
                }
                echo &#039;&lt;/select&gt;&#039;;
echo &#039;&lt;select name=&quot;expiye&quot; id=&quot;expiye&quot;&gt;&#039;;
	foreach ($meta_boxes[&#039;expiye&#039;][&#039;options&#039;] as $option) {
		echo &#039;&lt;option&#039;, $data[ &#039;expiye&#039; ] == $option ? &#039; selected=&quot;selected&quot;&#039; : &#039;&#039;, &#039;&gt;&#039;, $option, &#039;&lt;/option&gt;&#039;;
                }
                echo &#039;&lt;/select&gt;&#039;;
echo &#039;&lt;select name=&quot;expiti&quot; id=&quot;expiti&quot;&gt;&#039;;
	foreach ($meta_boxes[&#039;expiti&#039;][&#039;options&#039;] as $option) {
if ($option == &#039;00:00:00&#039;) {$optionez = &#039;12MN&#039;;
} elseif ($option == &#039;01:00:00&#039;) {$optionez = &#039;1AM&#039;;
} elseif ($option == &#039;02:00:00&#039;) {$optionez = &#039;2AM&#039;;
} elseif ($option == &#039;03:00:00&#039;) {$optionez = &#039;3AM&#039;;
} elseif ($option == &#039;04:00:00&#039;) {$optionez = &#039;4AM&#039;;
} elseif ($option == &#039;05:00:00&#039;) {$optionez = &#039;5AM&#039;;
} elseif ($option == &#039;06:00:00&#039;) {$optionez = &#039;6AM&#039;;
} elseif ($option == &#039;07:00:00&#039;) {$optionez = &#039;7AM&#039;;
} elseif ($option == &#039;08:00:00&#039;) {$optionez = &#039;8AM&#039;;
} elseif ($option == &#039;09:00:00&#039;) {$optionez = &#039;9AM&#039;;
} elseif ($option == &#039;10:00:00&#039;) {$optionez = &#039;10AM&#039;;
} elseif ($option == &#039;11:00:00&#039;) {$optionez = &#039;11AM&#039;;
} elseif ($option == &#039;12:00:00&#039;) {$optionez = &#039;12NN&#039;;
} elseif ($option == &#039;13:00:00&#039;) {$optionez = &#039;1PM&#039;;
} elseif ($option == &#039;14:00:00&#039;) {$optionez = &#039;2PM&#039;;
} elseif ($option == &#039;15:00:00&#039;) {$optionez = &#039;3PM&#039;;
} elseif ($option == &#039;16:00:00&#039;) {$optionez = &#039;4PM&#039;;
} elseif ($option == &#039;17:00:00&#039;) {$optionez = &#039;5PM&#039;;
} elseif ($option == &#039;18:00:00&#039;) {$optionez = &#039;6PM&#039;;
} elseif ($option == &#039;19:00:00&#039;) {$optionez = &#039;7PM&#039;;
} elseif ($option == &#039;20:00:00&#039;) {$optionez = &#039;8PM&#039;;
} elseif ($option == &#039;21:00:00&#039;) {$optionez = &#039;9PM&#039;;
} elseif ($option == &#039;22:00:00&#039;) {$optionez = &#039;10PM&#039;;
} else {$optionez = &#039;11PM&#039;;}
		echo &#039;&lt;option&#039;, &#039; value=&quot;&#039;, $option, &#039;&quot;&#039;,$data[ &#039;expiti&#039; ] == $option ? &#039; selected=&quot;selected&quot;&#039; : &#039;&#039;, &#039;&gt;&#039;, $optionez, &#039;&lt;/option&gt;&#039;;
                }
                echo &#039;&lt;/select&gt;&#039;;
echo &#039;&lt;p&gt;Select a date in the future for this post to expire.  Default date is one month into the future&lt;/p&gt;&lt;/div&gt;&#039;;
} elseif ($meta_box[ &#039;name&#039;] == &#039;autodelp&#039;) {
echo &#039;&lt;label for=&quot;Auto Delete&quot;&gt;Auto Delete?&lt;/label&gt;&#039;;
echo &#039;&lt;select name=&quot;autodelp&quot; id=&quot;autodelp&quot;&gt;&#039;;
                foreach ($meta_boxes[&#039;autodelp&#039;][&#039;options&#039;] as $option) {
                    echo &#039;&lt;option&#039;, $data[ &#039;autodelp&#039; ] == $option ? &#039; selected=&quot;selected&quot;&#039; : &#039;&#039;, &#039;&gt;&#039;, $option, &#039;&lt;/option&gt;&#039;;
                }
                echo &#039;&lt;/select&gt;&lt;p&gt;&#039;, $meta_box[ &#039;description&#039; ], &#039;&lt;/p&gt;&lt;/div&gt;&#039;;
} else {}
?&gt;

&lt;?php
}; ?&gt;

&lt;?php
if (get_the_time(&#039;m&#039;) == 12) {$mononet = 1;
} else {$mononet = 1 + get_the_time(&#039;m&#039;);}
$slashhh = &#039;/&#039;;
      $spaceeee = &#039; &#039;;
if ( $data[ &#039;expida&#039;] == &#039;-&#039;) {$datarr = $mononet.$slashhh.get_the_time(&#039;d/Y&#039;).$spaceeee.$data[ &#039;expiti&#039; ];
} else {$datarr = $data[ &#039;expimo&#039; ].$slashhh.$data[ &#039;expida&#039; ].$slashhh.$data[ &#039;expiye&#039; ].$spaceeee.$data[ &#039;expiti&#039; ];} ?&gt;
&lt;?php update_post_meta($post-&gt;ID, &#039;expiration&#039;, $datarr); ?&gt;
&lt;/div&gt;
&lt;?php
}
function save_meta_box( $post_id ) {
global $post, $meta_boxes, $key;

foreach( $meta_boxes as $meta_box ) {
$data[ $meta_box[ &#039;name&#039; ] ] = $_POST[ $meta_box[ &#039;name&#039; ] ];
}

if ( !wp_verify_nonce( $_POST[ $key . &#039;_wpnonce&#039; ], plugin_basename(__FILE__) ) )
return $post_id;

if ( !current_user_can( &#039;edit_post&#039;, $post_id ))
return $post_id;

update_post_meta( $post_id, $key, $data );
}

add_action( &#039;admin_menu&#039;, &#039;create_meta_box&#039; );
add_action( &#039;save_post&#039;, &#039;save_meta_box&#039; );
//end  post meta box
?&gt;
</pre>
<p>It&#8217;s a bit lengthy, but it does what it needs to.</p>
<p>Now open up your index.php or whichever file has the loop which you will need to edit and modify your loop between the <strong>while (have_posts())</strong> and <strong>endwhile </strong>statements as such:</p>
<pre class="brush: php">
&lt;?php while (have_posts()) : the_post(); $data = get_post_meta( $post-&gt;ID, &#039;Announcements&#039;, true );
	$expirationtime = get_post_custom_values(&#039;expiration&#039;);
if (is_array($expirationtime)) {
$expirestring = implode($expirationtime);
}
$secondsbetween = strtotime($expirestring)-time() + 14400;
if ( $secondsbetween &lt;= 0 &amp;&amp; $data[ &#039;autodelp&#039;] == &#039;yes&#039;) {
wp_delete_post($post-&gt;ID, false);
} elseif ( $secondsbetween &lt;= 0 &amp;&amp; $data[ &#039;autodelp&#039;] == &#039;no&#039;) {
} elseif ( $secondsbetween &gt; 0) {
	?&gt;
&lt;!--start your loop contents here. For example...--&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;p&gt;Posted on &lt;?php the_time(&#039;M.d, Y&#039;) ?&gt;&lt;/p&gt;
&lt;?php the_content(&#039;Read more &amp;raquo;&#039;); ?&gt;
&lt;!--end your loop contents here--&gt;
	&lt;?php } else {}
	endwhile; ?&gt;
</pre>
<p>Please note that <strong>14400</strong>on line 06 is to change the time to my current  time zone, US Eastern Time.  For best results, you should change this number to reflect your current timezone. To calculate the number you would use for your timezone, use this from <a href="http://www.rockia.com/2010/01/modify-you-wordpress-theme-to-enable-an-expiration-for-your-posting" target="blank">Modify you WordPress theme to enable an expiration date for your posting</a>:</p>
<blockquote><p>Let say, you are in GMT +7 time zone, you are ahead of time, so instead of “+”, you will need to “-” the difference, 7 hours = 7 * 60 *60 = 25200.</p></blockquote>
<p>Don&#8217;t forget to save and upload your changes.  To use the panel, while writing or editing a post, in the custom write panel named <strong>Announcements Post Options</strong>, simply select the date and time which you would like the post to expire under the <strong>Post Expiration Date</strong> section.  If you want the post to be deleted upon expiration, select <strong>yes</strong> in the <strong>Auto Delete</strong> section.  If no date is chosen, the post will automatically expire one month from the &#8220;publish date&#8221; of the post.</p>
<p>Hope you like that and find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://j3webworks.com/blog/wordpress-make-posts-expire-or-auto-delete/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>How to display the number of users in a WordPress site</title>
		<link>http://j3webworks.com/blog/how-to-display-the-number-of-users-in-a-wordpress-site</link>
		<comments>http://j3webworks.com/blog/how-to-display-the-number-of-users-in-a-wordpress-site#comments</comments>
		<pubDate>Tue, 25 May 2010 01:17:07 +0000</pubDate>
		<dc:creator>forlogos</dc:creator>
				<category><![CDATA[hack]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://j3webworks.com/?p=442</guid>
		<description><![CDATA[Recently at work I needed to display the number of users registered in a WordPress blog. Searching the web gave me the following PHP and mySQL code to display the number of registered users: &#60;?php $users = $wpdb-&#62;get_var(&#34;SELECT COUNT(ID) FROM $wpdb-&#62;users&#34;); echo $users.&#34; registered users.&#34;; ?&#62; But we were using the Register Plus plugin with [...]]]></description>
			<content:encoded><![CDATA[<p>Recently at work I needed to display the number of users registered in a WordPress blog.</p>
<p>Searching the web gave me the following PHP and mySQL code to display the number of registered users:</p>
<pre class="brush: php">
&lt;?php $users = $wpdb-&gt;get_var(&quot;SELECT COUNT(ID) FROM $wpdb-&gt;users&quot;);
echo $users.&quot; registered users.&quot;; ?&gt;
</pre>
<p>But we were using the <a href="http://wordpress.org/extend/plugins/register-plus/" target="blank">Register Plus</a> plugin with user moderation. Register Plus adds the prefix <strong>unverified__</strong> to all unverified WordPress usernames (so they can&#8217;t log in). Needless to say, we wanted to not include these unverified users from the count &#8211; so I changed the code to this:</p>
<pre class="brush: php">
&lt;?php $users = $wpdb-&gt;get_var(&quot;SELECT COUNT(ID) FROM $wpdb-&gt;users WHERE user_login NOT LIKE &#039;unverified__%&#039;&quot;);
echo $users.&quot; registered users.&quot;; ?&gt;
</pre>
<p>Lastly, we wanted to not include the 3 WordPress administrators we have from the user count.  So, I modified the code further like this:</p>
<pre class="brush: php">
&lt;?php $users = $wpdb-&gt;get_var(&quot;SELECT COUNT(ID) FROM $wpdb-&gt;users WHERE user_login NOT LIKE &#039;unverified__%&#039;&quot;);
$admins = 3;
echo $users - $admins .&quot; registered users.&quot;; ?&amp;&gt;
</pre>
<p>You can change the number in the line that says <strong>$admins = 3;</strong> to whatever number you want subtracted from the count.</p>
<p>And there you have it, an accurate WordPress registered user count.</p>
]]></content:encoded>
			<wfw:commentRss>http://j3webworks.com/blog/how-to-display-the-number-of-users-in-a-wordpress-site/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Custom Write Panels &amp; prioritizing what to display</title>
		<link>http://j3webworks.com/blog/wordpress-custom-write-panels-prioritizing-what-to-display</link>
		<comments>http://j3webworks.com/blog/wordpress-custom-write-panels-prioritizing-what-to-display#comments</comments>
		<pubDate>Wed, 07 Apr 2010 16:27:35 +0000</pubDate>
		<dc:creator>forlogos</dc:creator>
				<category><![CDATA[hack]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://j3webworks.com/?p=417</guid>
		<description><![CDATA[At work, I received a project for a vlog (video blog). Each WordPress blog post would have at most one video (some blog posts might have no video). Also, videos would be hosted either on an online video hosting site (i.e. Youtube, Vimeo..) or self hosted and accessed through a URL to a video ASX [...]]]></description>
			<content:encoded><![CDATA[<p>At work, I received a project for a vlog (video blog).</p>
<p>Each WordPress blog post would have at most one video (some blog posts might have no video).  Also, videos would be hosted either on an online video hosting site (i.e. Youtube, Vimeo..) or self hosted and accessed through a URL to a video ASX file or direct to a WMV/AVI.  Lastly, a page that displays only the videos posted with no other blog post information was also needed.</p>
<p>Video would be:</p>
<ul>
<li>from embed code from youtube, vimeo, etc</li>
<li>a url to a ASX/WMV/AVI file</li>
<li>or both</li>
</ul>
<p>Since a page that only displays videos is needed:</p>
<ul>
<li>creating a WordPress loop to display post excerpts would not work since the video would be removed and no text from the post should be displayed</li>
</ul>
<p>So I figured using custom write panels would be the best way to achieve all this and still make it easy for the end user.</p>
<p>For creating the custom write panel, I referenced this blog post: <a href="http://wefunction.com/2009/10/revisited-creating-custom-write-panels-in-wordpress/" target="blank">Revisited: Creating Custom Write Panels in WordPress</a>.  I pasted the final code to my functions.php file unchanged except for my two fields, which I named <strong>videoasx</strong> and <strong>embedcode</strong>. So my custom write panel looks like so:</p>
<p><img src="http://j3webworks.com/wp-content/uploads/custom-write-panel.gif" alt="WordPress custom write panel"/></p>
<p>The embed code will be pasted as provided by Youtube/Vimeo/etc, which is all the code needed to properly display a video.  For ASX/WMV/AVI urls, additional embed code is needed around the url to properly display an embedded video player. Prioritizing is needed to display a video if:</p>
<ul>
<li>neither embed code nor asx url is populated, then display nothing</li>
<li>only one, either the embed code or asx url is populated, then display the video</li>
<li>both are filled, display only the asx url video</li>
</ul>
<p>So I came up with the following PHP code to be added in the theme files where ever the video should be displayed:</p>
<pre class="brush: php">
&lt;?php if (!empty($data[ &#039;videoasx&#039; ])) {
	echo &#039;&lt;OBJECT   ID=&quot;WinMedia&quot;  classid=&quot;CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95&quot;  CODEBASE= &quot;http://activex.microsoft.com/activex/  controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701&quot;  width=480 height=295 standby=&quot;Loading Microsoft  Windows Media Player components...&quot; type=&quot;application  /x-oleobject&quot;&gt;&lt;PARAM NAME=&quot;FileName&quot;  VALUE=&quot;&#039;;
	echo $data[ &#039;videoasx&#039; ];
	echo &#039;&quot;&gt;&lt;PARAM NAME=&quot;AutoStart&quot; Value=&quot;false&quot;&gt;&lt;PARAM NAME=&quot;ShowControls&quot; Value=&quot;true&quot;&gt;&lt;Embed type=&quot;application/x-mplayer2&quot;    pluginspage=    &quot;http://www.microsoft.com/Windows/MediaPlayer/&quot;    src=&quot;&#039;;
	echo $data[ &#039;videoasx&#039; ];
	echo &#039;&quot;    Name=MediaPlayer    AutoStart=0    Width=480    Height=295    autostart=1    ShowControls=1  &lt;/embed&gt;&lt;/OBJECT&gt;&#039;;	}
elseif (!empty($data[ &#039;embedcode&#039; ])) {
	echo $data[ &#039;embedcode&#039; ]; }
else {
echo &#039;&#039;; } ?&gt;
</pre>
<p>This basically says:</p>
<ol>
<li>If the asx url is filled, then display the video with this embed code and the url provided,</li>
<li>if the asx url is empty, then display the embed code,</li>
<li>if the embed code is empty too, then display nothing.</li>
</ol>
<p>Which is quite different from the short php code that was provided in the article I referenced that will display just the contents of either field with no additional wrapping code or logic to display just one.</p>
<pre class="brush: php">
&lt;?php echo $data[ &#039;videoasx&#039; ]; ?&gt;
</pre>
<p>or</p>
<pre class="brush: php">
&lt;?php echo $data[ &#039;embedcode&#039; ]; ?&gt;
</pre>
<p>For creating the video only page, I created a WordPress loop that had nothing but my php code within.  Something like:</p>
<pre class="brush: php">
&lt;?php if ( have_posts()) : ?&gt;
&lt;?php while (have_posts()) : the_post(); $data = get_post_meta( $post-&gt;ID, &#039;key&#039;, true );?&gt;
	&lt;div class=&quot;video&quot;&gt;
		&lt;?php if (!empty($data[ &#039;videoasx&#039; ])) {
			echo &#039;&lt;OBJECT   ID=&quot;WinMedia&quot;  classid=&quot;CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95&quot;  CODEBASE= &quot;http://activex.microsoft.com/activex/  controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701&quot;  width=480 height=295 standby=&quot;Loading Microsoft  Windows Media Player components...&quot; type=&quot;application  /x-oleobject&quot;&gt;&lt;PARAM NAME=&quot;FileName&quot;  VALUE=&quot;&#039;;
			echo $data[ &#039;videoasx&#039; ];
			echo &#039;&quot;&gt;&lt;PARAM NAME=&quot;AutoStart&quot; Value=&quot;false&quot;&gt;&lt;PARAM NAME=&quot;ShowControls&quot; Value=&quot;true&quot;&gt;&lt;Embed type=&quot;application/x-mplayer2&quot;    pluginspage=    	&quot;http://www.microsoft.com/Windows/MediaPlayer/&quot;    src=&quot;&#039;;
			echo $data[ &#039;videoasx&#039; ];
			echo &#039;&quot;    Name=MediaPlayer    AutoStart=0    Width=480    Height=295    autostart=1    ShowControls=1  &lt;/embed&gt;&lt;/OBJECT&gt;&#039;;	}
		elseif (!empty($data[ &#039;embedcode&#039; ])) {
			echo $data[ &#039;embedcode&#039; ]; }
		else {
		echo &#039;&#039;; } ?&gt;
	&lt;/div&gt;
&lt;?php endwhile; ?&gt;&lt;?php else : ?&gt;
	&lt;div class=&quot;post&quot;&gt;
		&lt;?php _e(&#039;Sorry, but you are looking for something that isn&amp;#39;t here.&#039;); ?&gt;
	&lt;/div&gt;
&lt;?php endif; ?&gt;
</pre>
<p>And that&#8217;s that.  Hope this can help you somehow.</p>
<p>I&#8217;ll do my best to help answer any questions. Should you have any, please do not hesitate to leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://j3webworks.com/blog/wordpress-custom-write-panels-prioritizing-what-to-display/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: Display an image from a post or custom field</title>
		<link>http://j3webworks.com/blog/how-to-display-an-image-from-a-post-or-custom-field</link>
		<comments>http://j3webworks.com/blog/how-to-display-an-image-from-a-post-or-custom-field#comments</comments>
		<pubDate>Tue, 02 Feb 2010 04:09:33 +0000</pubDate>
		<dc:creator>forlogos</dc:creator>
				<category><![CDATA[hack]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://j3webworks.com/?p=387</guid>
		<description><![CDATA[In my other blog, Pet Turtles And More, I wanted to display one image from the content of my posts and be able to over-ride that image with another, if I so choose, within the WordPress loop . The result I wanted (which is what I got) looks like this: The first image in the [...]]]></description>
			<content:encoded><![CDATA[<p>In my other blog, <a href="http://www.petturtlesandmore.com/" target="blank">Pet Turtles And More</a>, I wanted to display one image from the content of my posts and be able to over-ride that image with another, if I so choose, within the WordPress loop .</p>
<p>The result I wanted (which is what I got) looks like this:<br />
<a href="http://www.petturtlesandmore.com/blog/category/photos/turtle-pictures/" title="turtle pictures" target="blank"><img src="http://j3webworks.com/wp-content/uploads/turtle-pictures.jpg" alt="turtle pictures" /></a><br />
The first image in the post is displayed or, if I designate an alternate, it will display an alternate image.</p>
<p>The first step I did was find a way to extract the image from a post.  I found this in the WordPress.org support forums: <a href="http://wordpress.org/support/topic/246893" target="blank">Retrieve First Image From Post</a>.</p>
<p>This worked beautifully, but noticed that it:</p>
<ol>
<li>didn&#8217;t give me an easy way to override the image if I didn&#8217;t like the one it chose (which is the first image)</li>
<li>if I had an advertisement, even one that is generated by an iframe, it would take the image from the ad and display it instead, and</li>
<li>if I use shortcode to display a gallery (like what is used to display a <a href="http://uninuni.com/wordpress-plugin-nextgen-smooth-gallery/" target="blank">NextGen Smooth gallery</a>, it wouldn&#8217;t be able to extract a photo</li>
</ol>
<p>So I looked for a way to add an image through the use of custom fields.  I found number 9 from <a href="http://www.smashingmagazine.com/2009/05/13/10-custom-fields-hacks-for-wordpress/" target="blank">Custom Fields Hacks For WordPress</a> to be most useful.</p>
<p>Then I did some nifty PHP to combine the two hacks and came out with this code.</p>
<p>Paste this into your theme&#8217;s functions.php file:</p>
<pre class="brush: php">
function get_custom_field_value($szKey, $bPrint = false) {
	global $post;
	$szValue = get_post_meta($post-&gt;ID, $szKey, true);
	if ( $bPrint == false ) return $szValue; else echo $szValue;
}

function catch_that_image() {
global $post, $posts;
$first_img = &#039;&#039;;
ob_start();
ob_end_clean();
$output = preg_match_all(&#039;/&lt;img.+src=[\&#039;&quot;]([^\&#039;&quot;]+)[\&#039;&quot;].*&gt;/i&#039;, $post-&gt;post_content, $matches);
$first_img = $matches [1] [0];
// no image found display default image instead
if(empty($first_img)){
$first_img = get_custom_field_value(&#039;mythumb&#039;);
}
return $first_img;
}
</pre>
<p>And use this within the WordPress loop for where you want to display the image:</p>
<pre class="brush: php">
&lt;?php
$customField = get_post_custom_values(&quot;mythumb&quot;);
if (isset($customField[0])) {
    echo &#039;&lt;img src=&quot;&#039;;
    echo &quot;&quot;.$customField[0];
	echo &#039;&quot; /&gt;&#039;; }
  else{
echo &#039;&lt;img src=&quot;&#039;;
echo (catch_that_image());
echo &#039;&quot; /&gt;&#039;; }
 ?&gt;
</pre>
<p>The code assumes that you are using a custom field called &#8220;mythumb&#8221; and that you are using the full URL path of the image for &#8220;mythumb&#8221;.</p>
<p>What the code does is it first tells WordPress to display the image in &#8220;mythumb&#8221; then if that custom field is empty, it will then display the first image in the post.  In effect, it displays the first image in a post or the one in a custom field.</p>
<p>A nice WP hack indeed!!</p>
]]></content:encoded>
			<wfw:commentRss>http://j3webworks.com/blog/how-to-display-an-image-from-a-post-or-custom-field/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Going to WordCamp NYC</title>
		<link>http://j3webworks.com/blog/going-to-wordcamp-nyc</link>
		<comments>http://j3webworks.com/blog/going-to-wordcamp-nyc#comments</comments>
		<pubDate>Thu, 29 Oct 2009 02:32:20 +0000</pubDate>
		<dc:creator>forlogos</dc:creator>
				<category><![CDATA[other]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://j3webworks.com/?p=377</guid>
		<description><![CDATA[I&#8217;ve been wanting to go to a WordCamp since I got into blogging&#8230;it took a few short years and now I&#8217;m finally going. WordCamp is going to be two whole conference days of nothing but WordPress. I like the sound of that&#8230; I even know one of the speakers! Sometimes, I work with WordPress all [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wanting to go to a WordCamp since I got into blogging&#8230;it took a few short years and now I&#8217;m finally going.</p>
<p><a href="http://2009.newyork.wordcamp.org" title="WordCampNYC – Nov 14-15" target="blank"><img alt="WordCampNYC – Nov 14-15" src="http://2009.newyork.wordcamp.org/files/2009/10/wcnyc-attending-250.jpg" /></a></p>
<p>WordCamp is going to be two whole conference days of nothing but WordPress.  I like the sound of that&#8230; </p>
<p>I even know one of the speakers!</p>
<p>Sometimes, I work with WordPress all day for work &#8211; then when I get home &#8211; I spend even more time working with WordPress for myself!!</p>
<p>Check out the <a href="http://2009.newyork.wordcamp.org/" target="blank">Word Camp NYC 2009 page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://j3webworks.com/blog/going-to-wordcamp-nyc/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated blog design</title>
		<link>http://j3webworks.com/blog/updated-blog-design</link>
		<comments>http://j3webworks.com/blog/updated-blog-design#comments</comments>
		<pubDate>Mon, 21 Sep 2009 19:44:22 +0000</pubDate>
		<dc:creator>forlogos</dc:creator>
				<category><![CDATA[other]]></category>

		<guid isPermaLink="false">http://j3webworks.com/?p=362</guid>
		<description><![CDATA[Since I do more Twitter updates and don&#8217;t blog here on this website as much as I do for my pet turtles or Brazilian Jiu-Jitsu websites &#8211; I decided to update the look of J3WebWorks.com. The blog page now features my latest tweets (Twitter messages) on top of my blog posts. I&#8217;m using the javascript [...]]]></description>
			<content:encoded><![CDATA[<p>Since I do more Twitter updates and don&#8217;t blog here on this website as much as I do for my pet turtles or Brazilian Jiu-Jitsu websites &#8211; I decided to update the look of J3WebWorks.com.</p>
<p>The <a href="http://j3webworks.com/blog" target="blank">blog page</a> now features my latest tweets (Twitter messages) on top of my blog posts.</p>
<p>I&#8217;m using the <a href="http://www.makkintosshu.com/journal/twitter-statuses-badge" target="blank">javascript Twitter Statuses Badge</a>, which I downloaded from <a href="http://www.makkintosshu.com/journal/twitter-statuses-badge" target="blank">http://www.makkintosshu.com/journal/twitter-statuses-badge</a>.  I customized it slightly to fit both my <a href="http://j3webworks.com/blog" target="blank">blog page</a> and the sidebar on <a href="http://j3webworks.com/" target="blank">my home page</a>.</p>
<p>I think it looks cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://j3webworks.com/blog/updated-blog-design/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WP-Cycle plugin: better than hacking NextGen Smooth</title>
		<link>http://j3webworks.com/blog/wp-cycle-plugin-better-than-hacking-nextgen-smooth</link>
		<comments>http://j3webworks.com/blog/wp-cycle-plugin-better-than-hacking-nextgen-smooth#comments</comments>
		<pubDate>Tue, 07 Jul 2009 02:59:35 +0000</pubDate>
		<dc:creator>forlogos</dc:creator>
				<category><![CDATA[plug ins]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://j3webworks.com/?p=244</guid>
		<description><![CDATA[A few weeks after I posted How to make NextGEN Smooth Gallery link to any URL (or fake a flash banner) I discovered the WP-Cycle plugin. It&#8217;s a great plugin, much easier to use than hacking NextGen Smooth, and I wish I had found it sooner. It is way simpler for getting each image in [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks after I posted <a href="http://j3webworks.com/blog/how-to-make-nextgen-smooth-gallery-link-to-any-url-or-fake-a-flash-banner" target="blank">How to make NextGEN Smooth Gallery link to any URL (or fake a flash banner)</a> I discovered the <a href="http://wordpress.org/extend/plugins/wp-cycle/" target="blank">WP-Cycle plugin</a>.</p>
<p>It&#8217;s a great plugin, much easier to use than hacking NextGen Smooth, and I wish I had found it sooner.  It is way simpler for getting each image in a rotating slideshow to point to a different URL.</p>
<p>How I implemented it (note: this is for version 0.1.5 of the plug-in) :<br />
<img class="alignnone size-full wp-image-245" title="WP-Cycle settings" src="http://j3webworks.com/wp-content/uploads/2009/07/WP-Cycle-settings.jpg" alt="WP-Cycle settings" width="596" height="483" /><small>(Blog title, URLs, and links blurred out in the image for client security)</small></p>
<ol>
<li>After installing the plugin, you will find the WP-Cycle settings as a sub-menu under the Plugins menu in the admin area of WordPress.</li>
<li>First thing to do is to upload the images you want to appear in the slidehow, browse for and upload your images.  There is currently no method to add an image from the WordPress Library or to use an image without importing it, hopefully that will change in a future release.  Also, it is better if all your images are the same size.</li>
<li>After uploading an image, you can enter the URL you want each image to link to.  This is the strength and the best part of WP-Cycle &#8211; you can link to <em>any</em> URL.  Be sure to include the &#8220;http://&#8221; and to click on &#8220;Update&#8221;.</li>
<li>Select your settings.  These are all up to your preferences.  For Image Dimensions it is best if you enter the exact same size as that of the images you are planning to use.  Don&#8217;t forget to &#8220;Save Settings&#8221;.</li>
</ol>
<p>To display the rotating banner, use the shortcode to display it in a post or page or use PHP to show them where ever you please in your themes files.</p>
<p>The short code is:</p>
<blockquote><p>&#91;wp_cycle&#93;</p></blockquote>
<p>The php is:</p>
<pre class="brush: php">&lt;?php wp_cycle(); ?&gt;</pre>
<p>The plugin says that you can set the DIV ID that will be used for the banner and thus be able to style it whatever way you want through CSS.  I wasn&#8217;t able to do this successfully.  I wanted to add a margin to the banner, so I surrounded it in another DIV with a class.</p>
<p>The complete code I added to the theme was:</p>
<pre class="brush: php">
&lt;div class=&quot;banner&quot;&gt;
&lt;?php wp_cycle(); ?&gt;
&lt;/div&gt;
</pre>
<p>In the style sheet I added (of course you can add whatever you want, depending on the styling you want):</p>
<pre class="brush: css">
.banner {
margin-left:11px;
}
</pre>
<p>And there you have it.  A simple rotating banner using any size of images that links to any URL for WordPress for free without using Flash or a paid program.</p>
<p>Please feel free to ask questions or leave comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://j3webworks.com/blog/wp-cycle-plugin-better-than-hacking-nextgen-smooth/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

