<?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 &#187; hack</title>
	<atom:link href="http://j3webworks.com/blog/category/wordpress/hack/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 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>How to make NextGEN Smooth Gallery link to any URL (or fake a flash banner)</title>
		<link>http://j3webworks.com/blog/how-to-make-nextgen-smooth-gallery-link-to-any-url-or-fake-a-flash-banner</link>
		<comments>http://j3webworks.com/blog/how-to-make-nextgen-smooth-gallery-link-to-any-url-or-fake-a-flash-banner#comments</comments>
		<pubDate>Fri, 26 Jun 2009 04:43:20 +0000</pubDate>
		<dc:creator>forlogos</dc:creator>
				<category><![CDATA[hack]]></category>
		<category><![CDATA[plug ins]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://j3webworks.com/?p=202</guid>
		<description><![CDATA[The following does not always work. If there are other instances of JS running on the public web page, there is a good chance that it will not work properly. That is the reason why the Smooth Gallery plugin gives the option to use iframes to fix the problem. I couldn&#8217;t find any free or [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>The following does not always work.  If there are other instances of JS running on the public web page, there is a good chance that it will not work properly.  That is the reason why the Smooth Gallery plugin gives the option to use iframes to fix the problem.</p></blockquote>
<p>I couldn&#8217;t find any free or open source tools to make flash banners or JS rotating image banners.  Everything I found had to be purchased, while the free versions were either limited to a specific image size or included a logo or link to promote the program&#8217;s website.  All I really wanted to do was create (or fake) a flash banner in which each image would link to a different URL.</p>
<p>I knew about <a href="http://uninuni.com/wordpress-plugin-nextgen-smooth-gallery/" target="blank">NextGEN Smooth Gallery</a>, an excellent add-on plugin to the best WordPress Image gallery, <a href="http://alexrabe.boelinger.com/wordpress-plugins/nextgen-gallery/" target="blank">NextGen</a>.  I couldn&#8217;t get either plug-in to work the way I wanted.  NextGen would link only to pages in the same WordPress install and Smooth Gallery would only link to a full-size version of the image you clicked on.</p>
<p>So, I implemented Smooth Gallery on a page, published it, viewed it, then looked at the resulting page source code.  Analyzing that, I figured out how to make each image in a NextGen Smooth Gallery slideshow link to a unique URL.</p>
<p>At the minimum, you need the following code:</p>
<blockquote><p>&lt;script type=&quot;text/javascript&quot;&gt;<br />
function start<span style="color: #0000ff;">Gallery_123</span>() {<br />
var myGallery = new gallery($(&quot;my<span style="color: #0000ff;">Gallery_123</span>&quot;), {<br />
timed: true,<br />
showCarousel: false,<br />
showInfopane: false,<br />
showArrows: false,<br />
embedLinks: true,<br />
slideInfoZoneOpacity: 0.80,<br />
delay: <span style="color: #ff0000;">3000</span>,<br />
defaultTransition: &quot;fade&quot;<br />
});<br />
document.getElementById(&quot;my<span style="color: #0000ff;">Gallery_123</span>&quot;).style.display = &quot;block&quot;;           }<br />
window.addEvent(&quot;domready&quot;, start<span style="color: #0000ff;">Gallery_123</span>);<br />
&lt;/script&gt;<br />
&lt;div id=&quot;my<span style="color: #0000ff;">Gallery_123</span>&quot; style=&quot;display:none; width: <span style="color: #ffff00;">300px</span> !important; height: <span style="color: #ff00ff;">160px </span>!important;&quot;&gt;</p>
<p>&lt;div class=&quot;imageElement&quot;&gt;<br />
&lt;a target=&quot;_self&quot; href=&quot;<span style="color: #008000;">http://www.theURLyouwanttolinkto.com/</span>&quot; title=&quot;<span style="color: #ff9900;">open</span>&quot; class=&quot;open&quot; &gt;&lt;/a&gt;<br />
&lt;img src=&quot;<span style="color: #993300;">http://image1.jpg</span>&quot; class=&quot;full&quot; /&gt;<br />
&lt;/div&gt;</p>
<p>&lt;div class=&quot;imageElement&quot;&gt;<br />
&lt;a target=&quot;_self&quot; href=&quot;<span style="color: #008000;">http://anotherURLyouwanttolinkto.com/</span>&quot; title=&quot;<span style="color: #ff9900;">open</span>&quot;  class=&quot;open&quot; &gt;&lt;/a&gt;<br />
&lt;img src=&quot;<span style="color: #993300;">http://image2.jpg</span>&quot; class=&quot;full&quot; /&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>Where,</p>
<ul>
<li><span style="color: #0000ff;">Gallery_123</span> (in <span style="color: #0000ff;">blue</span>) &#8211;  the numbers all need to be the same value.  In my example above I used 123.  The choice of number is irrelevant, but they all have to match</li>
<li><span style="color: #ff0000;">3000 </span>(in <span style="color: #ff0000;">red</span>) &#8211; is how long you want each image to show in milliseconds before it transitions to the next image.  The higher the number, the longer each image shows</li>
<li><span style="color: #ffff00;">300px </span>(in <span style="color: #ffff00;">yellow</span>) is the width of your images in pixels.  No space between the number and &#8216;px&#8217;</li>
<li><span style="color: #ff00ff;">160px </span>(in <span style="color: #ff00ff;">pink</span>) is the height of your images.  No space between the number and &#8216;px&#8217;</li>
<li><span style="color: #008000;">URLs to link to </span>(in <span style="color: #008000;">green</span>) that you want each image to link to.  Complete URLs with the &#8220;http://&#8221;  It can be any image, whether it&#8217;s in a NextGEN  gallery or not</li>
<li><span style="color: #ff9900;">title </span>text (in <span style="color: #ff9900;">orange</span>) the tooltip text you want to appear when the image is hovered over</li>
<li><span style="color: #993300;">Image URLs </span>(in <span style="color: #993300;">dark orange</span>) the complete URL of each image, complete with the &#8220;http://&#8221; and the file extension</li>
<li>you can repeat the divs with the link and image URLs as many times as you need, one time for every image you want to show</li>
</ul>
<p>Some notes:</p>
<ul>
<li>You need both the NextGen Gallery and NextGEN Smooth plugins activated to get this to work</li>
<li>Works best if all image are the same size.  If the image is too large, it will only show an incomplete image.  If it&#8217;s too small, the empty space will be filled in with a black background</li>
<li>Works by putting the code in a widget or in your template files</li>
<li>Errors can/will occur when you have other JS scripts running</li>
<li>For SEO purposes, you can add a header, such as &lt;h3&gt;&lt;/h3&gt; tags with a title right before the link tag &lt;a&gt;</li>
<li>You can also add alt text to each image e.g &lt;img src=&#8221;http://image.gif&#8221; alt=&#8221;alt text&#8221;&gt;</li>
<li>Oh yeah, this is for WordPress only!</li>
</ul>
<p>Hope this can help you somehow &#8211; I know it&#8217;s helping me, I&#8217;m using it!</p>
<p>Feel free to ask questions or post comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://j3webworks.com/blog/how-to-make-nextgen-smooth-gallery-link-to-any-url-or-fake-a-flash-banner/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

