<?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>Atalaya Studio &#187; Themes</title>
	<atom:link href="http://atalayastudio.com/archives/category/themes/feed" rel="self" type="application/rss+xml" />
	<link>http://atalayastudio.com</link>
	<description></description>
	<lastBuildDate>Mon, 08 Feb 2010 19:21:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Visually Controlling Menus using CSS Body Classes</title>
		<link>http://atalayastudio.com/archives/61</link>
		<comments>http://atalayastudio.com/archives/61#comments</comments>
		<pubDate>Mon, 30 Mar 2009 18:21:52 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Tips/Hints]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[conditional tags]]></category>
		<category><![CDATA[CSS tips]]></category>
		<category><![CDATA[theme integration]]></category>

		<guid isPermaLink="false">http://atalayastudio.com/?p=61</guid>
		<description><![CDATA[This was written in response to a discussion on the topic of conditionally managing menus&#8230; To control the visual presence of various menu levels, a fairly simple theme modification can be made using a php function written as a WordPress action and used in conjunction with a few CSS rules.

WordPress knows which type of query [...]]]></description>
			<content:encoded><![CDATA[<p>This was written in response to a discussion on the topic of conditionally managing menus&#8230; To control the visual presence of various menu levels, a fairly simple theme modification can be made using a php function written as a <a title="WordPress Actions API" href="http://codex.wordpress.org/Plugin_API" target="_blank">WordPress action</a> and used in conjunction with a few CSS rules.</p>
<p><span id="more-61"></span></p>
<p>WordPress knows which type of query has been requested and as a result, it sets one of the is_* conditional tags. For example, is_page(), is_single(), is_category(), etc. <a title="Word Press conditional tags" href="http://codex.wordpress.org/Conditional_Tags" target="_blank">(An explanation of the topic is provided here)</a></p>
<p>If I want to modify the contents or behavior of a menu I simply add a couple of things to the theme.</p>
<p>In the theme&#8217;s functions.php file, create a function that can determine which conditional tag is active; assign a php variable to a CSS class that corresponds to the current conditional tag. Here I have named a function <strong>setBodyClass</strong></p>
<pre class="brush: php">

/**
 * This function echos a CSS class statement
* that corresponds to the current conditional tag
 */
function setBodyClass() {

    /* Home page or front page ? */
    $class = (is_home() ? &quot;homepage&quot; : is_front_page() ? &quot;frontpage&quot; : &#039;&#039;);

   /* single page ? */
   $class = (is_single() ? &quot;single-page&quot; : $class);

   /* any category ? */
   $class = (is_category() ? &quot;category&quot; : $class):

   /* A specific category ? */
   if( is_category() ) {
      $cat_id = get_category_by_slug(&quot;news-category&quot;);
      if($cat_id) {
         $class = (is_category($cat_id) ? &quot;news-category&quot;: $class);
      }
   }

   if( &#039;&#039; != $class ) {
      echo &#039; class=&quot;&#039; . $class . &#039;&quot;&#039;;
   }
}// end function

/**
 * add this action
 */
add_action(&#039;setBodyClass&#039;);
</pre>
<p>Now that we have the function written we want to use the routine in the template file where the <strong>BODY tag</strong> is created. The BODY tag can typically be found in the <strong>header.php</strong> or <strong>index.php</strong> file of your theme. After locating the BODY tag modify the tag as follows:</p>
<pre class="brush: php">
&lt;body &lt;?php do_action(&#039;setBodyClass&#039;); ?&gt; &gt;
</pre>
<h3>What have we done here?</h3>
<p>We&#8217;ve just provided a method for dynamically adding a CSS class to the body tag of the page based on a set of conditional tags. The <strong>do_action </strong>call is an <em>action hook </em>that is exclusively provided by the theme&#8217;s <strong>functions.php</strong> file. <em>Theme&#8217;s can act as their own plugin functionality provider and mine often do</em>. This technique is a preferred (<em>by me</em>) over a direct php call to the <strong>setBodyClass </strong>function. The action will add the semantic class to the BODY tag if one of the conditions I care about is true. If the none of the conditions are met, then a CSS class is not added to the BODY tag. If the <strong>setBodyClass</strong> function was <span style="text-decoration: underline;">not present</span> in the theme&#8217;s <strong>functions.php</strong> file then nothing would happen.</p>
<h3>Body Class</h3>
<p>To visually control navigation menus I can now create CSS rules that determine what the web site visitor can see when specific content is displayed on the site. This works in conjunction with the applied BODY class. For example, NAVT applies specific classes to various types of menu items. The class <strong>page_item</strong> is applied to the unordered list tag that encapsulates an anchor to a page. It also applies the class <strong>cat_item</strong> to the unordered list tag that encapsulates an anchor to a category. More specific classes are also applied by NAVT for pages, categories and other list assets that are contained in the menus. There are too many to enumerate here.</p>
<h3>Example Menu with CSS</h3>
<p>Here is a simple menu that was generated by NAVT.</p>
<pre class="brush: html">

  &lt;ul class=&#039;menu samplemenu firefox en-US&#039;&gt;
    &lt;li class=&#039;erow samplemenu_item current_page_item hometab&#039;&gt;
      &lt;a href=&#039;http://wp.local&#039; title=&#039;Home&#039; class=&#039;navt_ilink current_item&#039;&gt;Home&lt;/a&gt;
    &lt;/li&gt;
    &lt;li class=&#039;orow samplemenu_item page_item about-page pagetab&#039;&gt;
      &lt;a href=&#039;http://wp.local/?page_id=2&#039; title=&#039;About&#039; class=&#039;navt_plink&#039;&gt;About&lt;/a&gt;
    &lt;/li&gt;
    &lt;li class=&#039;orow samplemenu_item page_item local-news-cat categorytab&#039;&gt;
      &lt;a href=&#039;http://wp.local/?cat=1&#039; title=&#039;Local News&#039; class=&#039;navt_clink&#039;&gt;Local News&lt;/a&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
</pre>
<p>If, for example, I did <span style="text-decoration: underline;">not want</span> to display the &#8220;Local News&#8221; category on the homepage or the front page I can easily write a CSS rule to hide the category when the visitor is on the home page or the front page:</p>
<pre class="brush: css">
body.frontpage ul.samplemenu li.local-news-cat,
body.homepage ul.samplemenu li.local-news-cat {
    display: none;
}
</pre>
<p>The CSS rule above <span style="text-decoration: underline;">hides the display</span> of the LI tag assigned the class <strong>local-news-cat</strong> that is a descendant of the UL tag with the class <strong>samplemenu</strong> that is a descendant of the BODY tag assigned the class <strong>frontpage </strong>or <strong>homepage</strong>.</p>
<h3>Conclusion</h3>
<p>This is an easy technique to apply (<em>your milage may vary</em>). Create the menus you want with NAVT, examine the tags created by the plugin and decide what you want to control and under what conditions then write the CSS rules accordingly.</p>
<p>I hope this was helpful, have fun&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://atalayastudio.com/archives/61/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with CSS Collapsing Menus and NAVT</title>
		<link>http://atalayastudio.com/archives/36</link>
		<comments>http://atalayastudio.com/archives/36#comments</comments>
		<pubDate>Tue, 13 May 2008 07:37:54 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[General Info]]></category>
		<category><![CDATA[NAVT]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Tips/Hints]]></category>
		<category><![CDATA[code insertion]]></category>
		<category><![CDATA[flyout menu]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://atalayastudio.com/?p=36</guid>
		<description><![CDATA[A discussion in the NAVT forum has promoted me to sit down and explain how you can use CSS collapsing menus with the NAVT plugin. This article assumes you have some working knowledge of Cascaded Style Sheets used to style your Word Press theme and some experience with NAVT.  The article explains where and [...]]]></description>
			<content:encoded><![CDATA[<p>A discussion in the NAVT forum has promoted me to sit down and explain how you can use CSS collapsing menus with the NAVT plugin. This article assumes you have some working knowledge of Cascaded Style Sheets used to style your Word Press theme and some experience with NAVT.  The article explains where and how to begin integrating a collapsing menu into your web site using NAVT to construct the correct tag structure.  This article applies to NAVT version 1.0.23 and above. <span id="more-36"></span></p>
<h3>Example Menu</h3>
<p>Below is an example of the type of menu we&#8217;re going to create using NAVT and two cascaded style sheets. The navigation elements shown in the menu are arbitrary items I put together from this web site.</p>
<div style="margin-left:40%;margin-bottom:40px;"></div>
<p>These types of menus are relatively easy to construct. However, the tricky part is making them work with IE6 and most of this article deals with the IE6 solution.</p>
<h3>Getting Started</h3>
<p>Examples of CSS style sheets that contain rules for formatting horizontal, vertical, fly-out, drop-down, and cascading menus can be found all over the Internet. When asked, I usually send people to <a title="CCS Play" rel="nofollow external" href="http://www.cssplay.co.uk/index" target="_blank">CSS Play</a> which is owned by Stuart Nicholls. CSS Play has dozens of examples of pure CSS menus that you can freely use on your non-commercial web site provided you leave the copyright statements intact that appear in the CSS file. These can also be used on Commercial web site&#8217;s provided you <a title="Copyright Permissions" rel="nofollow external" href="http://www.cssplay.co.uk/menus/drop_examples.html" target="_blank">obtain permission</a> from CSS Play.  For this tutorial, I&#8217;m going to use <a title="CSS Play Flyout menu" href="http://www.cssplay.co.uk/menus/flyoutt.html" target="_blank">this CSS Play flyout menu</a> to demonstrate the process of integrating the CSS into your web site in concert with NAVT.</p>
<p>You will, of course, need to change the menu text and background colors, adjust the menu width and heights and make any other style alterations to make the menu look right with the theme you intend to use the menu with.</p>
<h3>The !DOCTYPE</h3>
<p>Before I begin, it&#8217;s important to understand that your Word Press theme MUST use a <a title="!DOCTYPE" rel="nofollow" href="http://www.w3.org/QA/2002/04/valid-dtd-list.html" target="_blank">standards compliant !DOCTYPE</a>, and for Internet Explorer this MUST be the first line of your (x)html. Using <code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;</code> will switch IE into quirks mode and your menu will not work correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://atalayastudio.com/archives/36/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Embedded Navigation Groups</title>
		<link>http://atalayastudio.com/archives/31</link>
		<comments>http://atalayastudio.com/archives/31#comments</comments>
		<pubDate>Thu, 17 Apr 2008 19:11:18 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[General Info]]></category>
		<category><![CDATA[NAVT]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Tips/Hints]]></category>
		<category><![CDATA[Embedded Lists]]></category>
		<category><![CDATA[examples]]></category>

		<guid isPermaLink="false">http://atalayastudio.com/?p=31</guid>
		<description><![CDATA[Not long ago I wrote an article on how to embed navigation groups within pages and posts on your blog. This is probably one of the least used applications of NAVT. However, I think its a great feature if you have a sales organization or you operate a blog with multiple authors.
An embedded navigation list [...]]]></description>
			<content:encoded><![CDATA[<p>Not long ago I wrote an article on <a href="http://atalayastudio.com/archives/11" target="_self">how to embed navigation groups within pages and posts on your blog</a>. This is probably one of the least used applications of NAVT. However, I think its a great feature if you have a sales organization or you operate a blog with multiple authors.<span id="more-31"></span></p>
<p>An embedded navigation list can be used to create specialized pages that show the people in your organization using navigation list that contains user anchors.  Using a few CSS rules, a little layout imagination and a navigation group containing your blog Authors/Sales people you can create a unique organizational chart that is far more interesting than the ordinary about page.</p>
<p>Here is an example of an embedded navigation group on this page.</p>
<div style="text-align:left; width: 300px;">
<fieldset style="padding: 5px;">
<legend>Embedded Navigation Example</legend>
<p></fieldset>
</div>
]]></content:encoded>
			<wfw:commentRss>http://atalayastudio.com/archives/31/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to&#8230; Word Press, Themes and NAVT</title>
		<link>http://atalayastudio.com/archives/22</link>
		<comments>http://atalayastudio.com/archives/22#comments</comments>
		<pubDate>Sun, 30 Mar 2008 15:03:59 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[NAVT]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Tips/Hints]]></category>
		<category><![CDATA[theme integration]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[xpath expressions]]></category>

		<guid isPermaLink="false">http://atalayastudio.com/?p=22</guid>
		<description><![CDATA[Introduction
This topic has been written about many times by many people but this article has a NAVT slant. The information presented here is not intended to teach the basics of the PHP programming language, programming logic or WordPress template construction. It is designed to provide sensible help to the do it your-selfer who would like [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>This topic has been written about many times by many people but this article has a <em>NAVT slant</em>. The information presented here is not intended to teach the basics of the PHP programming language, programming logic or WordPress template construction. It is designed to provide sensible help to the <em>do it your-selfer</em> who would like to use the NAVT Plugin for WordPress and isn&#8217;t afraid to do a little template hacking to make it happen. <em>However there are at least three different ways you can integrate the NAVT plugin into your theme. <span style="text-decoration: underline;">Two of them don&#8217;t require programming</span>.</em><span id="more-22"></span></p>
<h3>The Theme Hack Method</h3>
<p>Template or theme hacking is the very thing I hope to prevent you from doing. Adding the necessary function call to your WordPress template for the NAVT plugin doesn&#8217;t take very long to do but you need to understand the following:</p>
<ul>
<li>Where the NAVT PHP interface call needs to be placed in your WordPress template,</li>
<li>How to correctly write the function call and,</li>
<li>How to style the resulting navigation list.</li>
</ul>
<h4>WordPress Theme Basics</h4>
<p>WordPress templates are not very mysterious if you understand some basic information. The content of your WordPress theme directory is composed of one large PHP script that is executed every time someone visits your blog. The theme script is divided into small files and each file name provides a clue to its intended use.</p>
<p>The typical WordPress theme usually contains (at a minimum) the following files:</p>
<ul>
<li>index.php</li>
<li>header.php</li>
<li>sidebar.php</li>
<li>footer.php</li>
</ul>
<p>The <em>index.php</em> file is the start of the PHP script and code execution begins with the very first line at the top of the index.php file and ends on the very last line. index.php is responsible for assembling all of the information that produces the pages of your WordPress blog. Page assembly (or production) is accomplished by making PHP function calls that are designed to create the HTML code that is, in turn, interpreted and displayed by the viewer&#8217;s web page browser. If you already know this, bear with me; it gets more interesting later.</p>
<p>There is a method to the madness of producing web pages by your WordPress theme. The method is simply the <em>loading and execution of known PHP files in a predetermined order</em>. The PHP files come from your theme&#8217;s directory. Specifically, the files named: <em>header.php, sidebar.php and footer.php</em>. If your theme is missing any one of these files, the file of the <em>same name will be used from the default theme directory in your WordPress installation.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://atalayastudio.com/archives/22/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
