<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>computeraxe</title>
	
	<link>http://computeraxe.com</link>
	<description>wordpress, php, mysql, jquery, css</description>
	<lastBuildDate>Tue, 29 May 2012 07:05:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/computeraxecom" /><feedburner:info uri="computeraxecom" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Site Accessibility Resources and Tools</title>
		<link>http://feedproxy.google.com/~r/computeraxecom/~3/hO0cRJx37XQ/</link>
		<comments>http://computeraxe.com/site-accessibility-resources-and-tools/#comments</comments>
		<pubDate>Tue, 29 May 2012 07:05:30 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=1276</guid>
		<description><![CDATA[The accessibility of a website must be directly proportional to the percentage of viewers who can actually see, read or hear the content. After all, if people can&#8217;t observe it, how are they going to get your message? Since web &#8230; <a href="http://computeraxe.com/site-accessibility-resources-and-tools/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The accessibility of a website must be directly proportional to the percentage of viewers who can actually see, read or hear the content. After all, if people can&#8217;t observe it, how are they going to get your message? </p>
<p>Since web developers don&#8217;t need to adapt the coding of sites for the majority of us to see the content, it may not come natural to them to include those who do need special consideration. It does take a little bit of extra time and thought to accommodate &#8211; <em>or dare I say be helpful to</em> &#8211; people with vision difficulties or those who use screen readers to use the Internet.</p>
<p>To get an idea if your sites pass muster, visit the accessibility links below for a little help.</p>
<h3>Links for Accessibility</h3>
<p><a href="http://www.sidar.org/hera/index.php.en">HERA accessibility testing</a> provides reports that show exactly where a site should be improved. If any errors are found when your site is scanned, they&#8217;re clearly highlighted so that you can take corrective action. A really helpful part is the &#8216;Navigate by guidelines&#8217; feature, where results are categorized by the accessibility guidelines. Stepping through the results under each guideline will show you exactly which parts of your site aren&#8217;t accessible, and it will help you learn more about the guidelines.</p>
<p><a href="http://wave.webaim.org/">WAVE Accessibility test</a> shows icons on the test results page where the guidelines weren&#8217;t met. Icons were extremely helpful in determining what parts of the page weren&#8217;t up to snuff. One feature to highlight is the &#8216;disable styles&#8217; button in the upper right of the results screen. Click that button to see your site without style sheets applied. If your content can be read without too much trouble, then it&#8217;s probably ok.</p>
<p><a href="http://juicystudio.com/services/readability.php">Readability test</a> provides results of three algorithms in judging the readability of text on the page. If your site deals with a technical subject, or if your content is too complex for the average Joe to easily understand, your site may not fair well on the readability tests. Keep in mind that Joe Public only reads at an 8th grade level. Sad, but true <img src='http://computeraxe.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> .</p>
<p><a href="http://juicystudio.com/services/csstest.php">CSS Analyzer</a> won&#8217;t give output until all CSS errors are corrected. It&#8217;s just not possible at this stage with WordPress sites due to partial implementation of HTML5.</p>
<p><a href="http://uitest.com/">UI Test</a> Enter your URL at <a href="http://uitest.com/en/check/">Site Test</a> for handy direct links to accessibility and validation checkers. Very helpful when modifying a page to meet accessibility guidelines.</p>
<p>The guidelines we&#8217;re talking about are the <a href="http://www.w3.org/WAI/intro/wcag.php" title="WCAG">Web Content Accessibility Guidelines</a> (WCAG) and the portion of U.S. Law for <a href="http://www.section508.gov/index.cfm?fuseAction=stdsSum" title="Section 508">Section 508</a> which requires that <em>information technology is accessible to people with disabilities</em>, at least in federal agencies. </p>
<img src="http://feeds.feedburner.com/~r/computeraxecom/~4/hO0cRJx37XQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/site-accessibility-resources-and-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://computeraxe.com/site-accessibility-resources-and-tools/</feedburner:origLink></item>
		<item>
		<title>CSS Resources and Tools</title>
		<link>http://feedproxy.google.com/~r/computeraxecom/~3/tYjpgo2y4vA/</link>
		<comments>http://computeraxe.com/css-resources-and-tools/#comments</comments>
		<pubDate>Tue, 22 May 2012 07:05:21 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=1262</guid>
		<description><![CDATA[Here&#8217;s a small collection of resources and tools for learning CSS, Cascading Style Sheets. It&#8217;s through links like the following that our collective CSS skills are improved. Read more, learn more. Links for CSS To get an idea of what &#8230; <a href="http://computeraxe.com/css-resources-and-tools/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a small collection of resources and tools for learning CSS, Cascading Style Sheets. It&#8217;s through links like the following that our collective CSS skills are improved. Read more, learn more.  </p>
<h3>Links for CSS</h3>
<p>To get an idea of what CSS can do for your site visit the <a href="http://www.csszengarden.com/">CSS Zen Garden</a>, a site for inspiration in designing with CSS. Studying the style sheets for the different themes presented here can teach you a lot about style and positioning.</p>
<p><a href="http://www.w3.org/MarkUp/Guide/Style">Introduction to CSS</a> by Dave Raggett at W3C. Even though it&#8217;s a bit dated this is a good place to start to see how CSS works. Get the basics about linking to a separate style sheet and setting link colors. </p>
<p><a href="https://developer.mozilla.org/en/CSS">CSS Reference and Tutorial</a> from the Mozilla Developer Network could be a one-stop shop for learning CSS. Pick the getting started tutorial if you&#8217;re not very familiar with using style sheets. If you already know the basics, you might want to bookmark the exhaustive CSS reference. It has browser support tabulated for all the CSS&nbsp;3 properties.</p>
<p><a href="http://reference.sitepoint.com/css">SitePoint CSS Reference</a> uses categories to organize pages into CSS-properties, CSS-selectors, at-rules, styling concepts and layout examples. Play around in the &#8220;live&#8221; area (you get there by selecting the &#8220;Play&#8221; tab) where you can post CSS rules or HTML markup in the left pane of the window and see the immediate effects in the right pane.</p>
<p>Interested when a particular feature showed up in the history of CSS? Check the <a href="http://meiert.com/en/indices/css-properties/">CSS Properties Index</a> for an alphabetical list of properties. Properties are tabulated for CSS1, CSS2, CSS2.1, and CSS3. Clicking on any property name will bring you a definition of that property along with its acceptable values, which elements it can be applied to, and whether it can be inherited.</p>
<p>Font stacks might be of interest in studying site designs and learning the underlying CSS. Each font stack is like a mini-library. Learn how to create your own <a href="http://www.codestyle.org/css/font-family/BuildBetterCSSFontStacks.shtml">CSS Font Stack</a> through examples of <a href="http://sitepointstatic.com/examples/font-stacks/font-stacks.txt">Eight Different Font Stacks</a>. Extend the idea to include basic page design via <a href="http://960.gs/">960 Grid</a>, a CSS library.</p>
<p>Great tutorials on specific CSS topics include:</p>
<ul>
<li><a href="http://css.maxdesign.com.au/">MaxDesign Listamatic tutorials</a> on lists, selectors, floats and CSS presentations</li>
<li><a href="http://www.slideshare.net/maxdesign/css3-media-queries">CSS3 @media queries</a> &#8211; excellent slideshow</li>
</ul>
<p>Once you start writing your own CSS you&#8217;ll want to know if everyone can see your site the way you intend it to be seen. Validating CSS will assure that your style sheet is valid and therefore understood by browsers that people use to see your site. Check your CSS style sheets with the <a href="http://jigsaw.w3.org/css-validator/#validate_by_uri+with_options">W3C CSS Validator</a>. <em>Tip: change profile to CSS3 and change vendor extensions to warnings, until CSS3 properties are more widely in use.</em></p>
<p>Keep reading, people. It&#8217;ll make you better at what you do.</p>
<img src="http://feeds.feedburner.com/~r/computeraxecom/~4/tYjpgo2y4vA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/css-resources-and-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://computeraxe.com/css-resources-and-tools/</feedburner:origLink></item>
		<item>
		<title>Pause and Play Buttons for jQuery Slideshow</title>
		<link>http://feedproxy.google.com/~r/computeraxecom/~3/vgFecRAb2LQ/</link>
		<comments>http://computeraxe.com/pause-and-play-buttons-for-jquery-slideshow/#comments</comments>
		<pubDate>Tue, 15 May 2012 07:05:07 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=1252</guid>
		<description><![CDATA[Continuing our slideshow journey with jQuery Cycle plugin, we&#8217;d like to improve our slider by adding two more buttons. Last time we looked at creating a slideshow with previous and next buttons, but now we&#8217;d like to add buttons for &#8230; <a href="http://computeraxe.com/pause-and-play-buttons-for-jquery-slideshow/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Continuing our slideshow journey with jQuery Cycle plugin, we&#8217;d like to improve our slider by adding two more buttons. Last time we looked at creating a <a href="http://computeraxe.com/previous-next-buttons-jquery-cycle-slideshow/" title="Next and previous buttons for Cycle slideshow.">slideshow with previous and next buttons</a>, but now we&#8217;d like to add buttons for pause and resume. It would be nice to allow site visitors to stop a slideshow with a pause button and resume the slideshow with a play button whenever they&#8217;re ready to continue.</p>
<p>If we keep the overall design the same, we just need to do two things to modify the slider. First, we need to upload the images for the pause and resume buttons and add a couple of lines to the HTML markup for positioning the buttons. We&#8217;ll fit the pause and play buttons in between the previous and next buttons. Each button will use an anchor tag, an id for CSS and script targeting, and a title for a user-friendly tooltip.</p>
<p><strong>HTML Markup for Slideshow Controls:</strong></p>
<pre class="crayon-plain-tag">&lt;div id=&quot;nav-buttons&quot;&gt;
  &lt;a id=&quot;prev2&quot; href=&quot;#&quot; title=&quot;previous slide&quot;&gt;&lt;img src=&quot;../images/previous.png&quot; alt=&quot;Previous&quot; /&gt;&lt;/a&gt;
  &lt;a id=&quot;pauseButton&quot; href=&quot;#&quot; title=&quot;pause slideshow&quot;&gt;&lt;img src=&quot;../images/pause.png&quot; alt=&quot;Pause&quot; /&gt;&lt;/a&gt;
  &lt;a id=&quot;resumeButton&quot; href=&quot;#&quot; title=&quot;resume slideshow&quot;&gt;&lt;img src=&quot;../images/play.png&quot; alt=&quot;Play&quot; /&gt;&lt;/a&gt;
  &lt;a id=&quot;next2&quot; href=&quot;#&quot; title=&quot;next slide&quot;&gt;&lt;img src=&quot;../images/next.png&quot; alt=&quot;Next&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;</pre>
<p>Second, we need to add a couple of lines to the script to manage the action when someone clicks either button. Here, we&#8217;re assigning Cycle&#8217;s pause or resume option to the click function of the selected <code>id</code>, in this case <code>#slide_aft</code>. Adding a &#8216;return false&#8217; line assures that the site visitor won&#8217;t be taken to another page when the buttons are clicked.</p>
<p><strong>jQuery script portion for pause and resume buttons:</strong></p>
<p></p><pre class="crayon-plain-tag">$('#pauseButton').click(function() {
	   $('#slide_aft').cycle('pause');
		 return false;
 });
 $('#resumeButton').click(function() {
	   $('#slide_aft').cycle('resume');
		 return false;
 });</pre><p></p>
<p>The above script portion was placed in the <code>document.ready function($)</code> so that the buttons are able to be used as soon as practical.</p>
<p>Here&#8217;s the full slideshow example with button controls for pause, resume or play, previous slide, and next slide.</p>
<div id="contain">
<div id="slide_aft">
    <img src="../images/1.jpg" alt="one" /><br />
    <img src="../images/2.jpg" alt="two" /><br />
    <img src="../images/3.jpg" alt="three" /><br />
    <img src="../images/4.jpg" alt="four" />
  </div>
<div id="nav-buttons">
  <a id="prev2" href="#" title="previous slide"><img src="../images/previous.png" alt="Previous" /></a><br />
<a id="pauseButton" href="#" title="pause slideshow"><img src="../images/pause.png" alt="Pause" /></a><br />
  <a id="resumeButton" href="#" title="resume slideshow"><img src="../images/play.png" alt="Play" /></a><br />
  <a id="next2" href="#" title="next slide"><img src="../images/next.png" alt="Next" /></a>
</div>
<p><!-- end div#nav-buttons -->
</div>
<p>Now, that looks a little better. This slideshow looks more complete having the pause and play or resume buttons, as well as the prev and next buttons.</p>
<img src="http://feeds.feedburner.com/~r/computeraxecom/~4/vgFecRAb2LQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/pause-and-play-buttons-for-jquery-slideshow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://computeraxe.com/pause-and-play-buttons-for-jquery-slideshow/</feedburner:origLink></item>
		<item>
		<title>Previous and Next Buttons in a jQuery Cycle Slideshow</title>
		<link>http://feedproxy.google.com/~r/computeraxecom/~3/jf-GM_toPq4/</link>
		<comments>http://computeraxe.com/previous-next-buttons-jquery-cycle-slideshow/#comments</comments>
		<pubDate>Tue, 08 May 2012 12:27:01 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[Cycle]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=1230</guid>
		<description><![CDATA[A site visitor to computeraxe wanted to know how to incorporate previous and next buttons in their slideshow using jQuery Cycle plugin. It&#8217;s easy! Let&#8217;s see an example, ok? If you haven&#8217;t checked out the simplicity of the jQuery Cycle &#8230; <a href="http://computeraxe.com/previous-next-buttons-jquery-cycle-slideshow/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A site visitor to computeraxe wanted to know how to incorporate previous and next buttons in their slideshow using jQuery Cycle plugin. It&#8217;s easy! Let&#8217;s see an example, ok?</p>
<p>If you haven&#8217;t checked out the simplicity of the jQuery Cycle plugin, you should because there&#8217;s a whole lot you can do with it. It&#8217;s a very versatile plugin and quite popular, which speaks to its usefulness &mdash; and cool factor, too. Previous posts here covered the basics about the <a href="http://computeraxe.com/javascript-plugin-jquery-cycle-for-slideshows/" title="jQuery Cycle plugin for slideshows">Cycle Plugin</a>, how to <a href="http://computeraxe.com/polaroid-slideshows-with-jquery-cycle-plugin/" title="Polaroid slideshow with Cycle">make slides look like Polaroids</a>, using <a href="http://computeraxe.com/slideshow-image-captions-with-jquery-cycle/" title="Slideshow image captions with jQuery Cycle">image captions with Cycle</a>, and discussions about a <a href="http://computeraxe.com/jquery-cycle-plugin-working-with-links/" title="Problems with transition effects and their solutions.">transition effects problem</a> with certain <em>fx</em>.</p>
<p>Let&#8217;s get into the example for making previous and next buttons for a slider in jQuery using the Cycle plugin. </p>
<p>Before writing any code it would be a good idea to sketch out the design for the slideshow. The photos or slides will be held in a container <code>div</code> that can be targeted for CSS styling and javascript. Captions and their container paragraph would also be placed inside the container <code>div</code>. In this example we&#8217;ll do away with the captions for simplicity and place the previous and next buttons inside the container <code>div</code>.</p>
<p>It turns out that Cycle has two options for creating the functionality for going to the next photo or the previous slide in a sequence. These options are appropriately named &#8216;next&#8217; and &#8216;prev&#8217;. The values to give for each are the locations of the next and previous buttons. To specify each location, create an <code>id</code>. </p>
<p>Here, we&#8217;re using <em>#next2</em> for the next button and <em>#prev2</em> for the previous button. Since we&#8217;re having only one next/previous button set for this slideshow, an <code>id</code> for each makes sense. If you have more than one slider on a page, a <code>class</code> would be more appropriate. When somebody wants to see the previous slide they&#8217;ll click on the &#8216;previous button&#8217;, so the best HTML tag for the slideshow controls is an anchor with a href of &#8216;#&#8217;. We don&#8217;t want to leave the page when clicking the previous button, we just want to see the previous slide in the show.</p>
<p><strong>HTML Markup:</strong></p>
<pre class="crayon-plain-tag">&lt;div id=&quot;contain&quot;&gt;
&lt;p&gt;Slideshow example using jQuery Cycle plugin with previous and next buttons.&lt;/p&gt;
  &lt;div id=&quot;slide_afta&quot;&gt;
    &lt;img src=&quot;../images/1.jpg&quot; alt=&quot;one&quot; /&gt;
    &lt;img src=&quot;../images/2.jpg&quot; alt=&quot;two&quot; /&gt;
    &lt;img src=&quot;../images/3.jpg&quot; alt=&quot;three&quot; /&gt;
    &lt;img src=&quot;../images/4.jpg&quot; alt=&quot;four&quot; /&gt;
  &lt;/div&gt;
&lt;div id=&quot;nav-buttonsa&quot;&gt;
  &lt;a id=&quot;prev2&quot; href=&quot;#&quot; title=&quot;previous slide&quot;&gt;&lt;img src=../images/previous.png&quot; alt=&quot;Previous&quot; /&gt;&lt;/a&gt;
  &lt;a id=&quot;next2&quot; href=&quot;#&quot; title=&quot;next slide&quot;&gt;&lt;img src=&quot;../images/next.png&quot; alt=&quot;Next&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;&lt;!-- end div#nav-buttons --&gt;
&lt;/div&gt;</pre>
<p>We&#8217;ll use a couple of small images to accommodate the previous and next slide functionality. One could use the words &#8216;prev&#8217; and &#8216;next&#8217; instead of images, if desired. In case a site visitor needs help, we&#8217;ve included a tooltip for each button by the way of a title for each anchor.</p>
<p>We want to hide all the images except the first image whenever the document is ready. Else, we&#8217;ll use the window load function for the slider action.</p>
<p><strong>jQuery:</strong></p>
<p></p><pre class="crayon-plain-tag">// jQuery Cycle options for slideshow with next/previous buttons

$(window).load(function() {
  $('#slide_afta').cycle({
     fx: 'fadeZoom',
     timeout: 2000,
     next: '#next2',
     prev: '#prev2',
     slideExpr: 'img'
   }); 	 
});

// hide all but the first image when document is ready

jQuery(document).ready(function($) {
  $('#slide_afta img:gt(0)').hide();
});</pre><p></p>
<p>Of course, there are many different ways to style your slideshow. Here&#8217;s our example Cycle slider with next and previous buttons.</p>
<div id="containa">
<p><em>Slideshow example using jQuery Cycle plugin with previous and next buttons.</em></p>
<div id="slide_afta">
    <img src="../images/1.jpg" alt="one" /><br />
    <img src="../images/2.jpg" alt="two" /><br />
    <img src="../images/3.jpg" alt="three" /><br />
    <img src="../images/4.jpg" alt="four" />
  </div>
<div id="nav-buttonsa">
  <a id="prev2" href="#" title="previous slide"><img src="../images/previous.png" alt="Previous" /></a><br />
  <a id="next2" href="#" title="next slide"><img src="../images/next.png" alt="Next" /></a>
</div>
<p><!-- end div#nav-buttonsa -->
</div>
<h3>What if you want two sliders on the same page?</h3>
<p>The first thing to recognize is that more than one <code>id</code> with the same name won&#8217;t work on the same page, so parts of the document for the second slider with an <code>id</code> will have to be changed over to a <code>class</code> or a different <code>id</code> name. CSS will have to be updated to reflect the changes, as will the javascript.</p>
<p>However, using the same <code>class</code> names for the next and previous controls for two sliders on the same page will result in both sliders being controlled by the same set of control buttons. That&#8217;s probably not what you&#8217;d want, nor what your site visitors would expect. Rename the action buttons (prev, next) and the container for the slides to different <code>class</code> names in order to be able to control the second slideshow. Of course, a second Cycle script would be needed to target the new container for the second slideshow.</p>
<img src="http://feeds.feedburner.com/~r/computeraxecom/~4/jf-GM_toPq4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/previous-next-buttons-jquery-cycle-slideshow/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://computeraxe.com/previous-next-buttons-jquery-cycle-slideshow/</feedburner:origLink></item>
		<item>
		<title>Taxonomies Classify and Organize WordPress Posts</title>
		<link>http://feedproxy.google.com/~r/computeraxecom/~3/_PHQPTzajaE/</link>
		<comments>http://computeraxe.com/taxonomies-classify-and-organize-wordpress-posts/#comments</comments>
		<pubDate>Tue, 01 May 2012 07:05:33 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[tags]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=1204</guid>
		<description><![CDATA[WordPress employs categories and tags as built-in taxonomies for posts and pages. Link categories are a taxonomy for the blogroll or links. So, what do we mean by taxonomy? The term &#8216;taxonomy&#8217; makes me think back to high school biology &#8230; <a href="http://computeraxe.com/taxonomies-classify-and-organize-wordpress-posts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>WordPress employs categories and tags as built-in taxonomies for posts and pages. Link categories are a taxonomy for the blogroll or links. So, what do we mean by <strong>taxonomy</strong>?</p>
<p>The term &#8216;taxonomy&#8217; makes me think back to high school biology class where we learned about Carolus Linnaeus. He was a botanist from the 18th century who devised a classification system for naming species that is still being used in the 21st century. This <em>Linnaean classification</em> system organizes species of plants and animals into hierarchical levels including Kingdom, Phylum, Class, Order, Family, Genus and Species.</p>
<p>With respect to biology taxonomy is the naming system used to identify millions of different creatures, both living and extinct. All species are classified according to their characteristics into broad groups containing similar organisms. Each broad group, like a kingdom or class, is subdivided into distinct sets, like family or genus. Being a member of a certain group means that you have certain characteristics in common with other members of the same group. Each organism can then be described according to the groups that it belongs to.</p>
<p>So, a taxonomy is a way to describe, identify, name and classify individual species. If we extend this idea to WordPress, a taxonomy becomes a way to organize and classify blog content.</p>
<p>Assigning a post or a page to a category or giving your article a couple of tags classifies and organizes the content. It helps the reader and search engines, too. Same with the link categories, they help us to organize links into meaningful groups.</p>
<p>Categories can have a hierarchy and can be divided into subcategories, but tags cannot. In describing categories we can use the term &#8216;parent category&#8217; for a larger category that has been divided into smaller groups or &#8216;children categories&#8217;. </p>
<p>Category hierarchy is useful when presenting information about large groups of things. For example, a site about muscle cars can have the broad categories of Chevrolet, Pontiac and Plymouth. Within the Chevy parent category, there might be subcategories of Chevelle, Camaro and Nova. LeMans and GTO could be child categories of the Pontiac parent category, and the Plymouth parent category might list Barracuda and Road Runner as subcategories. You get the idea.</p>
<p>By filing a post in a child category, it is not automatically a member of the parent category as well, so make sure to tick the parent category if that&#8217;s what you want.</p>
<p>Taxonomies are searchable so they are a way to help your site visitors find your information. Choose category names wisely at the start. You can still add or subtract categories as your blog develops, but if possible refrain from changing categories, especially if your permalinks, and therefore the URLs of your posts, use categories. It could be a nightmare to update all those links!</p>
<p>Tags are like keywords that describe a post, so they&#8217;re not thought out as part of the site structure like categories should be. Tags don&#8217;t have hierarchy and are described as having a <em>freeform and one-dimensional nature</em>. Basically, tags are used to further describe or classify a post or page. The same tag can be assigned to any number of posts or pages in any combination of categories.</p>
<p>Using taxonomies is a means for connecting posts together by relationship or similar characteristics. Grouping similar posts into categories and tagging them will help visitors to navigate and use your site.</p>
<p>But WordPress doesn&#8217;t stop there, it lets you to create special taxonomies for any of your sites. Custom taxonomies can be defined for custom post types, posts or pages, and have been around since WordPress version 2.3, but they didn&#8217;t gain the full capability for hierarchical structure until WP 3.0. </p>
<p>Interested in creating a <em>new, custom taxonomy</em> for your site? Study the codex examples for <a href="http://codex.wordpress.org/Function_Reference/register_taxonomy" title="WP codex register taxonomy">registering taxonomies</a>.</p>
<p>Categories, tags and custom taxonomies are enlisted as some of the post meta data. Post meta data includes the information about a post that helps to identify it. Examples of post meta data include the date and time it was published, the author&#8217;s name, the categories or tags assigned to the post, and the associated RSS feed.</p>
<img src="http://feeds.feedburner.com/~r/computeraxecom/~4/_PHQPTzajaE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/taxonomies-classify-and-organize-wordpress-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://computeraxe.com/taxonomies-classify-and-organize-wordpress-posts/</feedburner:origLink></item>
		<item>
		<title>WordPress Roles and Capabilities Trump User Levels</title>
		<link>http://feedproxy.google.com/~r/computeraxecom/~3/eXgO4O5BzwM/</link>
		<comments>http://computeraxe.com/wordpress-roles-and-capabilities-trump-user-levels/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 07:05:47 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[member]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=1180</guid>
		<description><![CDATA[When someone signs up on a WordPress blog, the default role is as a subscriber. Once a subscriber logs in they can view and edit their profile, which includes things like username, password and contact info, but that&#8217;s all they &#8230; <a href="http://computeraxe.com/wordpress-roles-and-capabilities-trump-user-levels/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When someone signs up on a WordPress blog, the default role is as a subscriber. Once a subscriber logs in they can view and edit their profile, which includes things like username, password and contact info, but that&#8217;s all they can do. A subscriber can&#8217;t write a post, edit a page or upload any files. A site member would need higher privileges to do any of those things.</p>
<p>To handle various levels of user privilege, a system was developed in WordPress that was originally called the User Level System. In this system many capabilities were identified and these capabilities were classified according to the level of authority required or the privileges needed to perform certain tasks. </p>
<p>For example, a higher level of privilege was deemed necessary to edit another writer&#8217;s post. Accordingly, a user level that is now called Editor was given a variety of capabilities ranging from <code>edit_others_posts</code> to <code>delete_published_posts</code>. A lower user level, now called Author, was awarded a slimmer set of capabilities and it doesn&#8217;t include modifying others&#8217; work. </p>
<h3>Make Sure Site Visitors Can Register</h3>
<p>To make sure your visitors can sign up to your blog, see the General Settings page under &#8220;New User Default Role&#8221; for a spin box that has the options of subscriber, administrator, editor, author and contributor. Default role is <strong>subscriber</strong>. </p>
<p>If you want people to be able to register on your blog, tick the Membership box next to &#8220;Anyone can register&#8221;, then click on the Save Changes button at the bottom of the page to make it so.</p>
<h3>User Levels Supplanted by Roles</h3>
<p>WordPress introduced user levels in version 1.5, but quickly replaced them in version 2.0 with Roles and Capabilities. User levels are deprecated since WP 3.0, but we may see them used in older plugins or themes, so it&#8217;s worth knowing about them. Basically, higher user levels have more privileges and can write, edit, post, publish and manage more than their lower-level counterparts.</p>
<p>The lowest user level equates with the subscriber role. Subscribers can sign in, see and modify their own profile, and besides that they can read posts and pages and comment.</p>
<p>The highest user level is reserved for the site administrator or blog owner and that would include level_0 up through level_10, the highest user level.</p>
<p>Prior versions of WordPress had 11 levels from level_0 to level_10, with level_0 being the lowest level and least capable, while level_10 users were able to do anything and everything with the WordPress blog.</p>
<p>WordPress defines users as the blog visitors who register and login to the web site. The Administrator is created during installation of the WordPress software. The Admin level has absolute power over all other users being able to add or delete users, edit their writings and promote or demote anyone to a different role.</p>
<p>Roles correspond to the old user level system like so:</p>
<ul>
<li>Subscriber = level_0</li>
<li>Contributor = level_0, level_1</li>
<li>Author = level_0 to level_2</li>
<li>Editor = level_0 to level_7</li>
<li>Admin = level_0 to level_10</li>
</ul>
<p>Many blog owners don&#8217;t need any special roles as they are the Admin and they control everything with their personal online spaces. Beyond the Admin there is a new level called Super Admin that comes into play when a network of sites needs to be administered. Multisite WordPress installations came into use as user levels were being deprecated, so there is no equivalent user level number for the Super Admin.</p>
<h3>Capabilities for Standard Roles</h3>
<p>The standard roles in WordPress are Administrator, Editor, Author, Contributor and Subscriber, in order of decreasing privilege.</p>
<p>The Admin user is created when WordPress is installed. Administrators have all capabilities, including the privileges to install, activate, edit and delete plugins, install, delete, edit or switch themes, edit or delete any post or page whether published or private, edit the dashboard, manage users, categories, links, options, comments and files, and import or export parts or all of the WordPress blog.</p>
<p>Editors have fewer privileges than admins, but they have the powers to manage their own and other&#8217;s posts. They can edit and delete pages or posts whether they&#8217;re published or private. Editors have the capabilities to manage categories, links and comments, and they can upload files. Editors can post code in pages, posts and comments, so make sure you trust your editors because they can post HTML markup or even JavaScript to your blog.</p>
<p>Authors have fewer privileges than editors and they all center around writing posts. Authors can publish, edit and delete the posts they create, even published ones. However, they cannot edit or delete other&#8217;s posts. Authors cannot create or alter Pages. They can upload files to add new media, and of course, read and comment on posts.</p>
<p>Contributors have even fewer privileges than authors. Contributors can edit, delete and read their own posts. Posts created by Contributors will be held in moderation for an Editor to approve and publish.</p>
<p>Finally, Subscribers have but two capabilities. They can read posts and they can view and update their own profile.</p>
<h3>Modifying and Managing Roles</h3>
<p>Several WordPress plugins exist for managing roles and capabilities. The plugins listed here get very high marks at the <a href="http://wordpress.org/extend/plugins/" title="WP plugin directory">WordPress Plugin Directory</a>.</p>
<p>Members Plugin</p>
<p><a href="http://wordpress.org/extend/plugins/members/" title="members wp plugin">Members plugin</a> is described as an &#8220;extensive role and capability management system&#8221; that allows you to create, edit and delete roles and capabilities for those roles. Using shortcodes, this plugin lets you control access to your content, including the ability to make the entire site and its RSS feed private.</p>
<p>Role Scoper Plugin</p>
<p><a href="http://wordpress.org/extend/plugins/role-scoper/" title="role scoper wp plugin">Role Scoper plugin</a> is a complete solution for assigning permissions and roles to specific pages, posts or categories. Independent of WP roles, users of any level can be elevated to read or edit any content. Alternatively, content can be restricted from any user regardless of their WP roles or capabilities.</p>
<p>User Access Manager Plugin</p>
<p><a href="http://wordpress.org/extend/plugins/user-access-manager/" title="user access manager wp plugin">User Access Manager plugin</a> lets you &#8220;manage the access to your posts, pages and files&#8221;. Reading and editing permissions for pages and posts are assigned via user groups. Registered users are placed into user groups for which appropriate access rights have been created. User groups can supplement or take the place of WP roles for providing or preventing access to pages and posts.</p>
<p>Advanced Access Manager Plugin</p>
<p><a href="http://wordpress.org/extend/plugins/advanced-access-manager/" title="advanced access manager wp plugin">Advanced Access Manager plugin</a> is a &#8220;powerful and flexible Access Control tool&#8221; that supports single and multisite WordPress installations. Roles can be created and capabilities assigned per role. The Dashboard and Admin menu can be filtered to show only the important bits for each role.</p>
<p>User Role Editor Plugin</p>
<p><a href="http://wordpress.org/extend/plugins/user-role-editor/" title="user role editor plugin">User Role Editor plugin</a> allows you to create new roles and customize their capabilities. Options include setting the default role for new users, removing capabilities from users, deleting roles no longer needed, and changing capabilities on a per user basis.</p>
<p><a href="http://www.garyc40.com/2010/04/ultimate-guide-to-roles-and-capabilities/" title="guide to roles and capabilities">Gary&#8217;s ultimate guide</a> for assigning user levels to roles and capabilities is most useful for those wanting to modify or create plugins and themes. Many code snippets are shared in this post for assigning capabilities, testing whether a user has a certain capability, and adding new roles and capabilities.</p>
<img src="http://feeds.feedburner.com/~r/computeraxecom/~4/eXgO4O5BzwM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/wordpress-roles-and-capabilities-trump-user-levels/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://computeraxe.com/wordpress-roles-and-capabilities-trump-user-levels/</feedburner:origLink></item>
		<item>
		<title>Putting Readable Code in a WordPress Post</title>
		<link>http://feedproxy.google.com/~r/computeraxecom/~3/aF-kgxoVYnI/</link>
		<comments>http://computeraxe.com/putting-readable-code-in-a-wordpress-post/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 07:05:47 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=1139</guid>
		<description><![CDATA[Writing about PHP or HTML code in WordPress posts or pages often requires that some actual code is shown on the screen for explanation. If special steps aren&#8217;t taken to illustrate the code as text, the result is often not &#8230; <a href="http://computeraxe.com/putting-readable-code-in-a-wordpress-post/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Writing about PHP or HTML code in WordPress posts or pages often requires that some actual code is shown on the screen for explanation. If special steps aren&#8217;t taken to illustrate the code as text, the result is often not what was intended to be seen because the WordPress engine will interpret the code as actual code, not text about code.</p>
<p>If all you want to do is highlight some text that includes code-related words like filenames, function names or plugin names, use <code>&lt;code&gt;&lt;/code&gt;</code> around those phrases in your text. Using <code>&lt;code&gt;&lt;/code&gt;</code> turns text into a <code>monospaced font </code>so that it appears differently in your posts than &#8220;normal&#8221; text. However, using <code>&lt;code&gt;&lt;/code&gt;</code> around an HTML tag doesn&#8217;t do anything except change the presentation of the tag, so the opening and closing angle brackets are interpreted to enclose an <em>actual HTML tag</em>. The result will be a mess and definitely not what you were hoping to see.</p>
<p>To make WordPress show code in a post without interpreting it, you have to do ONE of three things:</p>
<ol>
<li>Use special character codes to replace angle brackets of tags.</li>
<li>Use the HTML tag <code>&lt;pre&gt;&lt;/pre&gt;</code> around the code.</li>
<li>Use a plugin to highlight the code syntax.</li>
</ol>
<h3>1. Special Character Codes</h3>
<p>Angle brackets, &lt; or &gt;, are what WordPress uses to identify code, whether it&#8217;s HTML, inline styles of CSS, or PHP. Content inside angle brackets is interpreted as code by virtue of placement inside the brackets. Instead of interpreting this code we want WordPress to show the code to the site visitors and we can use special character codes to do that. </p>
<p>Character codes are special sequences of letters or digits that are used to represent textual characters. Every character that we see on the screen, including uppercase letters, lowercase letters, numbers, and symbols like &lt;, &gt;, #, $, %, ^, &#038; or *, can be represented by character codes, sometimes called character entities.</p>
<p>Using character codes in posts looks a little strange in the editing panel, but when a browser comes across these codes they are interpreted and their textual equivalent is shown on the screen.</p>
<p>ASCII (American Standard Code for Information Interchange) <a href="http://www.ascii.cl/htmlcodes.htm" title="ascii character entities"> character codes</a> were developed to represent text in electronic devices  and they follow a specific format. The format is that each character entity starts with an ampersand and ends with a semi-colon. The codes are a couple to a few letters or numbers. Numbered character codes always have a hash symbol right after the opening ampersand. Some entities can be represented by either numbered or named codes.</p>
<p><strong>Examples of special character codes:</strong></p>
<table>
<tr>
<th>Character name</th>
<th>Character symbol</th>
<th>Character ASCII Code</th>
<tr>
<tr>
<td>left angle bracket</td>
<td>&lt;</td>
<td>&amp;lt;</td>
</tr>
<tr>
<td>right angle bracket</td>
<td>&gt;</td>
<td>&amp;gt;</td>
</tr>
<tr>
<td>ampersand</td>
<td>&amp;</td>
<td>&amp;amp;</td>
</tr>
<tr>
<td>dollar sign</td>
<td>&#36;</td>
<td>&amp;#36;</td>
</tr>
<tr>
<td>long dash</td>
<td>&mdash;</td>
<td>&amp;mdash;</td>
</tr>
<tr>
<td>short dash</td>
<td>&ndash;</td>
<td>&amp;ndash;</td>
</tr>
<tr>
<td>double quotes</td>
<td>&quot;</td>
<td>&amp;quot;</td>
</tr>
<tr>
<td>at sign</td>
<td>&#64;</td>
<td>&amp;#64;</td>
</tr>
</table>
<p>If you need to find a code for language sets other than English, try the unicode site for all the <a href="http://www.unicode.org/charts/" title="unicode character code charts">code charts</a> you&#8217;ll ever need. There, you can find numeric codes for fun game pieces, like chess, mahjong or checkers, horoscope symbols, smiley faces, weather symbols, music notes, and much more.</p>
<p><strong>Take caution:</strong> Just because you can enter a special code to represent a symbol, that doesn&#8217;t mean your computer will let you see it. Many operating systems will not have the proper fonts installed to make use of all of these codes, especially if they represent symbols that aren&#8217;t on your keyboard. Stick to the ASCII codes as many of the unicodes won&#8217;t be seen by your site visitors.</p>
<h3>2. HTML tag: &lt;pre&gt;</h3>
<p>Perhaps you&#8217;d like to show a block of HTML code on your post and have it shown as text. To make sure that your block of code is not interpreted as actual code, wrap it with <code>&lt;pre&gt;&lt;/pre&gt;</code> tags. The <code>&lt;pre&gt;</code> tag will change the appearance of the code into a <code>monospace font</code>, just like <code>&lt;code&gt;</code> does, but the difference is that <code>&lt;pre&gt;</code> also illustrates the code exactly as it was typed. All text, characters, spaces and line feeds will be reproduced exactly how they were entered. No code will be run when it&#8217;s protected inside the opening <code>&lt;pre&gt;</code> and closing <code>&lt;/pre&gt;</code> tags.</p>
<h3>3. Syntax Highlighter Plugins</h3>
<p>A final way to illustrate code in a WordPress post or page is to use a plugin to highlight the code. Several plugins are available for syntax highlighting purposes. </p>
<p>One that I have been using lately is called <a href="http://wordpress.org/extend/plugins/crayon-syntax-highlighter/" title="crayon syntax highlighter plugin">Crayon Syntax Highlighter</a>. It&#8217;s a great plugin that will colorize or highlight code that you wrap with shortcodes. There are lots of options if you want fine control over the color scheme. Themes come with the plugin so you have several choices for making your code look good.</p>
<p>There are two modes where you can highlight code differently using shortcodes, <code>&#91;crayon&#93;&#91;/crayon&#93;</code> and <code>&#91;plain&#93;&#91;/plain&#93;</code>. Use <code>&#91;plain&#93;</code> shortcodes when the colorized crayon is overkill or when you just want to show a small section of code. Crayon Syntax Highlighter supports a wide range of languages, including HTML, CSS, PHP and JavaScript, for starters.</p>
<p>The colorful <code>&#91;crayon&#93;</code> shortcode is controlled by options where you can pick the colors that you want for representing different sections or purposes in your code. Inline crayons are supported so you could put a line of code within a line of text and the code would be colorized.</p>
<p>Some other popular code-highlighting plugins include <a href="http://wordpress.org/extend/plugins/syntaxhighlighter/" title="SyntaxHighlighter Evolved plugin">SyntaxHighlighter Evolved</a>, <a href="http://wordpress.org/extend/plugins/wp-syntax/" title="WP Syntax plugin">WP-Syntax</a>, and <a href="http://wordpress.org/extend/plugins/codecolorer/" title="Code Colorer plugin">CodeColorer</a>. I don&#8217;t have any personal experience with these plugins, but they are listed high in popularity at the <a href="http://wordpress.org/extend/plugins/" title="WordPress Plugin Directory">WordPress Plugin Directory</a>.</p>
<h3>Need to Execute Code in a Post?</h3>
<p>If what you&#8217;re really after is to put executable code in a post or WordPress Page, check out this post on <a href="http://computeraxe.com/using-php-inside-content-wordpress-blogs/" title="run PHP inside a blog post">executing PHP in WordPress</a> blogs.</p>
<img src="http://feeds.feedburner.com/~r/computeraxecom/~4/aF-kgxoVYnI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/putting-readable-code-in-a-wordpress-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://computeraxe.com/putting-readable-code-in-a-wordpress-post/</feedburner:origLink></item>
		<item>
		<title>Loading WordPress with One jQuery</title>
		<link>http://feedproxy.google.com/~r/computeraxecom/~3/f1tE9-1Z354/</link>
		<comments>http://computeraxe.com/loading-wordpress-with-one-jquery/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 07:05:22 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[CDN]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=1090</guid>
		<description><![CDATA[If there are several plugins on your WordPress sites there may be more than one copy of jQuery, or other script, that&#8217;s loaded, especially if you&#8217;re relying on the same scripts for control of the site theme as well. Only &#8230; <a href="http://computeraxe.com/loading-wordpress-with-one-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If there are several plugins on your WordPress sites there may be more than one copy of jQuery, or other script, that&#8217;s loaded, especially if you&#8217;re relying on the same scripts for control of the site theme as well. Only one copy of each script should be loading up. More than that represents wasted bandwidth for you and wasted time for your site visitors.</p>
<p>To control what scripts are used on your site it may be wise to learn how to disable scripts from loading in the first place. Similar methods can be applied to streamline the number of scripts or stylesheets loaded onto your site.</p>
<p>Check out this great <a href="http://justintadlock.com/archives/2009/08/06/how-to-disable-scripts-and-styles" title="disable styles and scripts">tutorial on disabling scripts</a> and styles. Thanks for sharing, Justin!</p>
<p>You&#8217;ll need to modify the <code>functions.php</code> file of your theme to remove styles or scripts. The technique is similar in each case.</p>
<ol>
<li>Find the &#8216;handle&#8217; of the script that you&#8217;d like to remove.</li>
<li>Pass the script handle to <code>wp_deregister_script()</code>.</li>
<li>Wrap one or more &#8216;deregistrations&#8217; in a new function, like <code>my_deregister_javascript()</code> in this example.</li>
<li>Use <code>add_action()</code> with <code>wp_print_scripts</code> method and add your new function to the <code>functions.php</code> file of your theme.</li>
</ol>
<pre class="crayon-plain-tag">function my_deregister_javascript() {
  wp_deregister_script('jquery-form');
}
add_action('wp_print_scripts', 'my_deregister_javascript');</pre>
<p>From the reference on <code>add_action</code> in the WordPress codex we can see that two arguments are required, namely the <code>$tag</code> or handle of the script and the <code>$function_to_add</code> or the function to which the script is hooked. Two optional parameters can be added to the <code>add_action</code> function to specify the <code>$priority</code> or the order in which the functions are executed, and <code>$accepted_args</code> or the number of arguments that the function accepts. Generically,</p>
<pre class="crayon-plain-tag">add_action( $tag, $function_to_add, $priority, $accepted_args );</pre>
<p>In the example above we&#8217;ve used &#8216;wp_print_scripts&#8217; for <code>$tag</code> and &#8216;my_deregister_javascript&#8217; for <code>$function_to_add</code> while the optional <code>$priority</code> and <code>$accepted_args</code> were not used. This will hook the new function &#8216;my_deregister_javascript&#8217; to the action called &#8216;wp_print_scripts&#8217;.</p>
<p>Alternatively, a WordPress plugin could be used to manage the scripts and actions called for on your site. <a href="http://wordpress.org/extend/plugins/use-google-libraries/" title="how to get google to load jQuery on your sites">Use Google Libraries</a> is a plugin built to detect the scripts needed for a site to run properly, including all the scripts called for by plugins and the active theme. Scripts are loaded in the proper order taking into account dependencies, whether previously known to WordPress or whether provided by the plugin and theme authors. This plugin uses the content delivery network (CDN) of google to supply the most popular javascript libraries, including jQuery and jQuery UI, among others.</p>
<img src="http://feeds.feedburner.com/~r/computeraxecom/~4/f1tE9-1Z354" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/loading-wordpress-with-one-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://computeraxe.com/loading-wordpress-with-one-jquery/</feedburner:origLink></item>
		<item>
		<title>WordPress jQuery Loaded in noConflict Mode</title>
		<link>http://feedproxy.google.com/~r/computeraxecom/~3/od5NzHikGME/</link>
		<comments>http://computeraxe.com/wordpress-jquery-loaded-in-noconflict-mode/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 07:05:20 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=1088</guid>
		<description><![CDATA[Loading JavaScripts in WordPress queues up the internal, minified versions of scripts like jQuery that come with WordPress. jQuery is loaded in noConflict mode so javascript code won&#8217;t work if it uses the &#8220;$&#8221; shortcut like so: $(document).ready(function(){ $(.slideshow1).cycle(); }); &#8230; <a href="http://computeraxe.com/wordpress-jquery-loaded-in-noconflict-mode/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://computeraxe.com/include-jquery-or-javascripts-in-wordpress/" title="including javascripts in wordpress">Loading JavaScripts in WordPress</a> queues up the internal, minified versions of scripts like jQuery that come with WordPress. jQuery is loaded in noConflict mode so javascript code won&#8217;t work if it uses the &#8220;$&#8221; shortcut like so:</p>
<pre class="crayon-plain-tag">$(document).ready(function(){
  $(.slideshow1).cycle();
});</pre>
<p>A simple solution is to pass the dollar sign in the anonymous function of a ready() call and that way the code that you&#8217;ve already written with the $ shortcut will work ok. The dollar sign acts as an <em>alias</em> for jquery.</p>
<pre class="crayon-plain-tag">jQuery(document).ready(function($){
.
.
//javascript code in here can use the $() shortcut instead of jQuery()
.
.
});</pre>
<p>Alternatively, instead of waiting for the entire document to be rendered as with the ready() method above, the javascript can be put in the following jQuery wrapper so that the code can be used right away.</p>
<pre class="crayon-plain-tag">(function($) {
  	$('#newsticker').innerfade({
	  animationtype: 'slide',
	  speed: 750,
	  timeout: 2000,
	  containerheight: '30px'
	});
})(jQuery);</pre>
<p>Using one of these jQuery wrappers is recommended to avoid conflicts with other scripts that may rely on the dollar sign shortcut on your WordPress sites.</p>
<img src="http://feeds.feedburner.com/~r/computeraxecom/~4/od5NzHikGME" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/wordpress-jquery-loaded-in-noconflict-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://computeraxe.com/wordpress-jquery-loaded-in-noconflict-mode/</feedburner:origLink></item>
		<item>
		<title>Include jQuery or JavaScripts in WordPress</title>
		<link>http://feedproxy.google.com/~r/computeraxecom/~3/JNqbkqhjdek/</link>
		<comments>http://computeraxe.com/include-jquery-or-javascripts-in-wordpress/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 07:05:56 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=1006</guid>
		<description><![CDATA[Plugin and theme authors use jQuery for their special effects, but there seems to be some confusion about the proper way to include JavaScript files in WordPress. If you&#8217;d like to use jQuery effects on your pages or in your &#8230; <a href="http://computeraxe.com/include-jquery-or-javascripts-in-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Plugin and theme authors use jQuery for their special effects, but there seems to be some confusion about the proper way to include JavaScript files in WordPress. If you&#8217;d like to use jQuery effects on your pages or in your theme, or if you want to include any javascript plugin or personal script, read on to see how to do it properly with WordPress sites.</p>
<h2>Queue Up Your Scripts with Actions</h2>
<p>Since jQuery itself is already included in the core of WordPress, how should we include a javascript file that we&#8217;ve created or even one of the <a href="http://computeraxe.com/most-popular-jquery-plugins/" title="popular jQuery plugins">popular jQuery plugins</a> that rely on jQuery? WordPress helps us in this endeavor with a function called &#8216;<em>wp_enqueue_script()</em>&#8216; and two actions that are used to call this special function.</p>
<p>The actions are used for either the user side or the admin side, depending on the purpose of your javascript. Use the &#8216;<em>wp_enqueue_scripts</em>&#8216; action to call <code>wp_enqueue_script()</code> for use in your themes. If the script functionality is needed on the admin side, use &#8216;<em>admin_enqueue_scripts</em>&#8216; action instead.</p>
<p>The format of the <code>wp_enqueue_script()</code> function call is as follows:</p>
<pre class="crayon-plain-tag">wp_enqueue_script('$handle', '$src', '$deps', '$ver', '$in_footer');</pre>
<p>where <em>$handle</em> is the name of the script as a lowercase string, <em>$src</em> is the URL to the script<note - don't hard code_>, <em>$deps</em> is an array of scripts that the script you&#8217;re calling depends on or the scripts that must be loaded first for your script to work, <em>$ver</em> is the script&#8217;s version number in string format, and <em>$in_footer</em> is a boolean value to indicate whether the script should be loaded in the &lt;head&gt; or at the end of the &lt;body&gt; in the footer. </p>
<p>The <em>$handle</em> string is the only required parameter, so the other four parameters are optional. The <em>$src</em>, <em>$ver</em>, and <em>$in_footer</em> parameters default values are &#8216;false&#8217;, and <em>$deps</em> defaults to an empty array.</p>
<p>It seems that <em>$src</em> would need to be a required option, but WordPress already knows about several scripts and where to find them. Consult the list of <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Default_scripts_included_with_WordPress" title="Where to find the default scripts included with WordPress">default scripts included with WordPress</a> to pick up their handles.</p>
<p>For example, to queue the jQuery Color plugin, we&#8217;d simply use this:</p>
<pre class="crayon-plain-tag">wp_enqueue_script('jquery-color');</pre>
<p>To include a script and specify the source, try this for including the jQuery Cycle plugin in the &lt;head&gt;:</p>
<pre class="crayon-plain-tag">wp_enqueue_script('jquery-cycle', 'URL', array('jquery'), '1.3.2');</pre>
<p>The URL should not be a hard-coded value for local scripts. Refer to the Function Reference pages in the codex for proper <a href="http://codex.wordpress.org/Function_Reference/plugins_url" title="plugins reference">URL formats for plugins</a> and <a href="http://codex.wordpress.org/Function_Reference/get_template_directory_uri" title="themes reference">themes</a>.</p>
<h2>Register Your Scripts First</h2>
<p>Make sure that your scripts are registered first before calling them. Registering a script basically tells WordPress where to find the code for your script. Use the function <code>wp_register_script()</code> to specify the location and handle of your script. The format is similar to the <code>wp_enqueue_script()</code> function:</p>
<pre class="crayon-plain-tag">wp_register_script('$handle', '$src', '$deps', '$ver', '$in_footer');</pre>
<p>The parameters have the same meanings and default values as used with <code>wp_enqueue_script()</code>. When in doubt, see what the WordPress Codex has to say about <code><a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script" title="enqueue scripts">wp_enqueue_script()</a></code> and <code><a href="http://codex.wordpress.org/Function_Reference/wp_register_script" title="register scripts">wp_register_script()</a></code>.</p>
<h2>Create a Function for the Header</h2>
<p>Put it all together using <code>wp_register_script()</code>, <code>wp_enqueue_script()</code>, and the appropriate action to call the functions. Create a simple function, like <code>id_scripts()</code> below, and use the <code>add_action()</code> hook to queue up the scripts. </p>
<p></p><pre class="crayon-plain-tag">function id_scripts() {
   wp_register_script('script_alpha', 'URL', array('jquery'), '1.0');
   wp_enqueue_script('script_alpha');
}
add_action('wp_enqueue_scripts', 'id_scripts');</pre><p></p>
<p>As a side note jQuery itself doesn&#8217;t have to be queued via a statement like <code>wp_enqueue_script('jquery');</code>, because it is listed as a dependency of &#8216;<em>script-alpha</em>&#8216; in this case.</p>
<p>When enqueuing a custom script that depends on a jQuery plugin, specify jQuery and its plugin in the <em>$deps</em> parameter of the <code>wp_register_script()</code> action for the custom script. For example, if your custom script depends on the jQuery Cycle plugin, which itself depends on jQuery, use<code> array('jquery', 'jquery-cycle')</code> for the <em>$deps</em> parameter. This specifies that both jQuery and its plugin Cycle should be loaded (in that order) before the custom script.</p>
<p>Place this code in the <code>header.php</code> of your theme. Remember, first register the javascript file, then enqueue it and make sure this is done before the <code>wp_head();</code> statement. Your custom script can then be placed in <code>header.php</code> after the <code>wp_head()</code> call.</p>
<h2>Use Theme functions.php to Safely Reference Your Script</h2>
<p>When using a child theme take note that the <code>header.php</code> in a child theme will override the default <code>header.php</code> in the parent theme. Instead of placing the script-queuing code in the header, one could more safely put this code in <code>functions.php</code>. The advantage to that way is that the <code>functions.php</code> of a child theme is processed <em>before</em> the <code>functions.php</code> of the parent theme. Both the parent and child theme <code>functions.php</code> are processed, unlike <code>header.php</code> files.</p>
<p>If you&#8217;re the least bit unsure about messing with <code>header.php</code>, then just use <code>functions.php</code> to queue up your javascript files. Don&#8217;t forget the opening and closing PHP tags in <code>functions.php</code>, else it won&#8217;t work. Put the javascript that would come after the <code>wp_head()</code> call in a separate <code>.js</code> file in the child theme and you&#8217;re good to go.</p>
<p>Verify that everything is working correctly by viewing the source of the HTML document for a WordPress post that should have the script included. The &lt;script&gt; tags should be visible in the header or in the footer depending on how the scripts were called.</p>
<img src="http://feeds.feedburner.com/~r/computeraxecom/~4/JNqbkqhjdek" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/include-jquery-or-javascripts-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://computeraxe.com/include-jquery-or-javascripts-in-wordpress/</feedburner:origLink></item>
	</channel>
</rss>

