<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>ThemeShaper Forums Tag: thematic_access</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Sat, 18 May 2013 19:22:08 +0000</pubDate>

<item>
<title>colfelt on "Thematic menus - wrapping the &#60;li&#62; in the &#60;a&#62;"</title>
<link>http://themeshaper.com/forums/topic/thematic-menus-wrapping-the-ltligt-in-the-ltagt#post-26701</link>
<pubDate>Sun, 29 Apr 2012 00:11:14 +0000</pubDate>
<dc:creator>colfelt</dc:creator>
<guid isPermaLink="false">26701@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;It's all on my local server right now. Nevermind, your suggestion was WAY better. As usual, I was looking for a complicated way to solve a simple problem. &#60;/p&#62;
&#60;p&#62;Displaying the A element as a block and giving it a width attribute is all that was required.&#60;/p&#62;
&#60;p&#62;Thanks again HtV!
&#60;/p&#62;</description>
</item>
<item>
<title>helgatheviking on "Thematic menus - wrapping the &#60;li&#62; in the &#60;a&#62;"</title>
<link>http://themeshaper.com/forums/topic/thematic-menus-wrapping-the-ltligt-in-the-ltagt#post-26697</link>
<pubDate>Sat, 28 Apr 2012 17:54:35 +0000</pubDate>
<dc:creator>helgatheviking</dc:creator>
<guid isPermaLink="false">26697@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;do you have a link to the styling you're using / trying to achieve?  i think it is a mistake to invert the markup... you're probably better off wrapping the text in an extra span so&#60;br /&#62;
&#60;code&#62;&#38;lt;li&#38;gt;&#38;lt;a&#38;gt;&#38;lt;span&#38;gt;&#60;/code&#62; which should also be easier to create via a Walker.&#60;/p&#62;
&#60;p&#62;but maybe you just need to put display: block on the A element and then add your padding to that.
&#60;/p&#62;</description>
</item>
<item>
<title>colfelt on "Thematic menus - wrapping the &#60;li&#62; in the &#60;a&#62;"</title>
<link>http://themeshaper.com/forums/topic/thematic-menus-wrapping-the-ltligt-in-the-ltagt#post-26694</link>
<pubDate>Sat, 28 Apr 2012 13:55:40 +0000</pubDate>
<dc:creator>colfelt</dc:creator>
<guid isPermaLink="false">26694@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;I read through ALL 5 pages of posts in Helga's epic Thematic Menus Demystified topic and the other topics I could find. But I *think* I have a new challenge for this forum.&#60;/p&#62;
&#60;p&#62;Is there a &#34;clever&#34; way to flip the order of the &#60;strong&#62;li&#60;/strong&#62; and &#60;strong&#62;a&#60;/strong&#62; tags output in wp_nav_menu? I know I could remove thematic_access and smash in my own hand-rolled menu in it's place. But that seems like a clumsy solution.&#60;/p&#62;
&#60;p&#62;Why do I want to do this? Well, I've re-oriented my menu so it's vertical. And I have created nice backgrounds on hover with CSS, so the list items are a bit like buttons. But, you still have to click on the actual word in the menu list item (which is what the anchor tag wraps) and you can't click the rest of the block list item that is highlighted on hover (because the &#60;strong&#62;a&#60;/strong&#62; doesn't wrap the &#60;strong&#62;li&#60;/strong&#62;). In short, it's a usability problem when something highlights that you can't click.&#60;/p&#62;
&#60;p&#62;Does anybody know how I would alter the code (via my own functions.php) that generates wp_nav_menu (it's in includes/nav-menu-template - function start_el - line 67)? to switch these tags around?&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function start_el(&#38;#38;$output, $item, $depth, $args) {
		global $wp_query;
		$indent = ( $depth ) ? str_repeat( &#38;quot;\t&#38;quot;, $depth ) : &#38;#39;&#38;#39;;

		$class_names = $value = &#38;#39;&#38;#39;;

		$classes = empty( $item-&#38;gt;classes ) ? array() : (array) $item-&#38;gt;classes;
		$classes[] = &#38;#39;menu-item-&#38;#39; . $item-&#38;gt;ID;

		$class_names = join( &#38;#39; &#38;#39;, apply_filters( &#38;#39;nav_menu_css_class&#38;#39;, array_filter( $classes ), $item, $args ) );
		$class_names = &#38;#39; class=&#38;quot;&#38;#39; . esc_attr( $class_names ) . &#38;#39;&#38;quot;&#38;#39;;

		$id = apply_filters( &#38;#39;nav_menu_item_id&#38;#39;, &#38;#39;menu-item-&#38;#39;. $item-&#38;gt;ID, $item, $args );
		$id = strlen( $id ) ? &#38;#39; id=&#38;quot;&#38;#39; . esc_attr( $id ) . &#38;#39;&#38;quot;&#38;#39; : &#38;#39;&#38;#39;;

		$output .= $indent . &#38;#39;&#38;lt;li&#38;#39; . $id . $value . $class_names .&#38;#39;&#38;gt;&#38;#39;;

		$attributes  = ! empty( $item-&#38;gt;attr_title ) ? &#38;#39; title=&#38;quot;&#38;#39;  . esc_attr( $item-&#38;gt;attr_title ) .&#38;#39;&#38;quot;&#38;#39; : &#38;#39;&#38;#39;;
		$attributes .= ! empty( $item-&#38;gt;target )     ? &#38;#39; target=&#38;quot;&#38;#39; . esc_attr( $item-&#38;gt;target     ) .&#38;#39;&#38;quot;&#38;#39; : &#38;#39;&#38;#39;;
		$attributes .= ! empty( $item-&#38;gt;xfn )        ? &#38;#39; rel=&#38;quot;&#38;#39;    . esc_attr( $item-&#38;gt;xfn        ) .&#38;#39;&#38;quot;&#38;#39; : &#38;#39;&#38;#39;;
		$attributes .= ! empty( $item-&#38;gt;url )        ? &#38;#39; href=&#38;quot;&#38;#39;   . esc_attr( $item-&#38;gt;url        ) .&#38;#39;&#38;quot;&#38;#39; : &#38;#39;&#38;#39;;

		$item_output = $args-&#38;gt;before;
		$item_output .= &#38;#39;&#38;lt;a&#38;#39;. $attributes .&#38;#39;&#38;gt;&#38;#39;;
		$item_output .= $args-&#38;gt;link_before . apply_filters( &#38;#39;the_title&#38;#39;, $item-&#38;gt;title, $item-&#38;gt;ID ) . $args-&#38;gt;link_after;
		$item_output .= &#38;#39;&#38;lt;/a&#38;gt;&#38;#39;;
		$item_output .= $args-&#38;gt;after;

		$output .= apply_filters( &#38;#39;walker_nav_menu_start_el&#38;#39;, $item_output, $item, $depth, $args );
	}

	/**
	 * @see Walker::end_el()
	 * @since 3.0.0
	 *
	 * @param string $output Passed by reference. Used to append additional content.
	 * @param object $item Page data object. Not used.
	 * @param int $depth Depth of page. Not Used.
	 */
	function end_el(&#38;#38;$output, $item, $depth) {
		$output .= &#38;quot;&#38;lt;/li&#38;gt;\n&#38;quot;;
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I'm not confident that I can create something that will work...
&#60;/p&#62;</description>
</item>
<item>
<title>helgatheviking on "Conditionally Removing thematic_access"</title>
<link>http://themeshaper.com/forums/topic/conditionally-removing-thematic_access#post-12323</link>
<pubDate>Wed, 12 May 2010 03:17:47 +0000</pubDate>
<dc:creator>helgatheviking</dc:creator>
<guid isPermaLink="false">12323@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;wish I could edit my post for it's glaring typo (function name mismatch):&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function remove_access() {
if (is_page_template(&#38;#39;affiliate.php&#38;#39;)) {
remove_action(&#38;#39;thematic_header&#38;#39;,&#38;#39;thematic_access&#38;#39;,9);
}
add_action(&#38;#39;wp_head&#38;#39;,&#38;#39;remove_access&#38;#39;);
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>BenParis on "Conditionally Removing thematic_access"</title>
<link>http://themeshaper.com/forums/topic/conditionally-removing-thematic_access#post-12254</link>
<pubDate>Mon, 10 May 2010 02:15:32 +0000</pubDate>
<dc:creator>BenParis</dc:creator>
<guid isPermaLink="false">12254@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;I'll try these. Thank you
&#60;/p&#62;</description>
</item>
<item>
<title>helgatheviking on "Conditionally Removing thematic_access"</title>
<link>http://themeshaper.com/forums/topic/conditionally-removing-thematic_access#post-12200</link>
<pubDate>Fri, 07 May 2010 04:52:06 +0000</pubDate>
<dc:creator>helgatheviking</dc:creator>
<guid isPermaLink="false">12200@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;caveat that the first snippet works for me on a page where the slug is a-video-post and the second snippet works on any page that is using my fullpage.php template&#60;/p&#62;
&#60;p&#62;assuming your affiliate template is affiliate.php you'd need:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function remove_menu() {
if (is_page_template(&#38;#39;affiliate.php&#38;#39;)) {
remove_action(&#38;#39;thematic_header&#38;#39;,&#38;#39;thematic_access&#38;#39;,9);
}
add_action(&#38;#39;wp_head&#38;#39;,&#38;#39;remove_access&#38;#39;);
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>helgatheviking on "Conditionally Removing thematic_access"</title>
<link>http://themeshaper.com/forums/topic/conditionally-removing-thematic_access#post-12199</link>
<pubDate>Fri, 07 May 2010 04:52:05 +0000</pubDate>
<dc:creator>helgatheviking</dc:creator>
<guid isPermaLink="false">12199@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;caveat that the first snippet works for me on a page where the slug is a-video-post and the second snippet works on any page that is using my fullpage.php template&#60;/p&#62;
&#60;p&#62;assuming your affiliate template is affiliate.php you'd need:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function remove_menu() {
if (is_page_template(&#38;#39;affiliate.php&#38;#39;)) {
remove_action(&#38;#39;thematic_header&#38;#39;,&#38;#39;thematic_access&#38;#39;,9);
}
add_action(&#38;#39;wp_head&#38;#39;,&#38;#39;remove_access&#38;#39;);
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>helgatheviking on "Conditionally Removing thematic_access"</title>
<link>http://themeshaper.com/forums/topic/conditionally-removing-thematic_access#post-12196</link>
<pubDate>Fri, 07 May 2010 01:50:11 +0000</pubDate>
<dc:creator>helgatheviking</dc:creator>
<guid isPermaLink="false">12196@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;For your template condition you have to use the name of your template file... so template.php and not just template.  As for the page condition, I can only guess your page slug is not 'affiliate'&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function remove_access() {
  if (is_page(&#38;#39;a-video-page&#38;#39;)){
  remove_action(&#38;#39;thematic_header&#38;#39;,&#38;#39;thematic_access&#38;#39;,9);
  } else {
  // do nothing
  }
}

add_action(&#38;#39;template_redirect&#38;#39;, &#38;#39;remove_access&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;pre&#62;&#60;code&#62;function remove_access() {
   if (is_page_template(&#38;#39;fullpage.php&#38;#39;)){
    remove_action(&#38;#39;thematic_header&#38;#39;,&#38;#39;thematic_access&#38;#39;,9);
   } else {
   // do nothing
   }
}

add_action(&#38;#39;wp_head&#38;#39;, &#38;#39;remove_access&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Both of those work for me.
&#60;/p&#62;</description>
</item>
<item>
<title>BenParis on "Conditionally Removing thematic_access"</title>
<link>http://themeshaper.com/forums/topic/conditionally-removing-thematic_access#post-12194</link>
<pubDate>Fri, 07 May 2010 01:20:41 +0000</pubDate>
<dc:creator>BenParis</dc:creator>
<guid isPermaLink="false">12194@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;thank you in advance thematic geniuses&#60;/p&#62;
&#60;p&#62;Helga has already offered some help, much appreciated!&#60;/p&#62;
&#60;p&#62;i'm trying to remove the menu from one page.  I've tried adding the following to my funcitions.php file with no luck&#60;/p&#62;
&#60;p&#62;function remove_access() {&#60;br /&#62;
if (is_page('affiliate')) {&#60;br /&#62;
remove_action('thematic_header','thematic_access',9);&#60;br /&#62;
}&#60;br /&#62;
add_action('template_redirect', 'remove_access');&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;AND THIS&#60;/p&#62;
&#60;p&#62;function remove_menu() {&#60;br /&#62;
if (is_page('affiliate')) {&#60;br /&#62;
remove_action('thematic_header','thematic_access',9);&#60;br /&#62;
}&#60;br /&#62;
add_action('template_redirect', 'remove_menu');&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;AND THIS&#60;/p&#62;
&#60;p&#62;created a template called 'affiliate' &#60;/p&#62;
&#60;p&#62;then added this to functions.php&#60;/p&#62;
&#60;p&#62;function remove_menu() {&#60;br /&#62;
if (is_page_template('affiliate')) {&#60;br /&#62;
remove_action('thematic_header','thematic_access',9);&#60;br /&#62;
}&#60;br /&#62;
add_action('wp_head','remove_access');&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;Don't know what i'm doint wrong.  I can unconditionally remove the menu.
&#60;/p&#62;</description>
</item>
<item>
<title>helgatheviking on "Conditionally Removing thematic_access"</title>
<link>http://themeshaper.com/forums/topic/conditionally-removing-thematic_access#post-11591</link>
<pubDate>Tue, 20 Apr 2010 15:27:01 +0000</pubDate>
<dc:creator>helgatheviking</dc:creator>
<guid isPermaLink="false">11591@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Almost posted a new thread b/c I couldn't get this to work w/ if (is_page_template()).  But checked out the link Gene posted to the WP action hooks and found that to conditionally remove #access based on a template then you have to edit Val's code to:&#60;/p&#62;
&#60;p&#62;add_action('wp_head','remove_access');&#60;/p&#62;
&#60;p&#62;do so love finding answers in the archives
&#60;/p&#62;</description>
</item>
<item>
<title>jmslbam on "Conditionally Removing thematic_access"</title>
<link>http://themeshaper.com/forums/topic/conditionally-removing-thematic_access#post-10783</link>
<pubDate>Wed, 17 Mar 2010 15:58:33 +0000</pubDate>
<dc:creator>jmslbam</dc:creator>
<guid isPermaLink="false">10783@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi Val &#38;#38; em hr,&#60;/p&#62;
&#60;p&#62;It works like a charm! Thanks for posting your solution!&#60;/p&#62;
&#60;pre&#62;
function page_checking() {
    if(is_front_page()){
        add_action('the_content', 'front_page_content');
    }
}
//as suggested by Gene add action to template_redirect
add_action('template_redirect', 'page_checking');

function front_page_content() {
    //you can work your magic here so it only shows the returned string on the front_page
    return 'x';
}
?&#38;gt;
&#60;/pre&#62;</description>
</item>
<item>
<title>Val on "Conditionally Removing thematic_access"</title>
<link>http://themeshaper.com/forums/topic/conditionally-removing-thematic_access#post-10479</link>
<pubDate>Fri, 05 Mar 2010 15:25:41 +0000</pubDate>
<dc:creator>Val</dc:creator>
<guid isPermaLink="false">10479@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;@Gene,&#60;/p&#62;
&#60;p&#62;&#60;strong&#62;Thank you!&#60;/strong&#62; Your suggestion launched an inquiry and solved my problem.&#60;/p&#62;
&#60;p&#62;I read through parts of the Codex: template hierarchy, API Plugins, actions vs filters and one WordPress forum post from mrfields explaining the difference between actions and filters (understand &#34;objectively&#34;; don't get it intuitively. Still unclear as to  how to implement a filter. Shelved for later.)&#60;/p&#62;
&#60;p&#62;You're correct! init does fire way too soon for checking is_home()!&#60;/p&#62;
&#60;p&#62;If I understand what I've read, template_loader.php makes a call to the get_home_template function in theme.php. While that function is filterable, I'm not concerned with acting on that hook. (Would that be the correct way to say that?)&#60;/p&#62;
&#60;p&#62;I'm concerned with overriding the thematic_access function in header-extensions.php when home.php is loaded.&#60;/p&#62;
&#60;p&#62;Here is the path through the darkness:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function remove_access() {
// testing implicitly for home.php removes thematic_access from all files. Hmmm.
// ? value of $template remains home.php for every subsequent query?
// This does not work. Try something else.
// if ($template = &#38;#39;home.php&#38;#39;) {
//
// Testing around is_home() appears to work, leaving thematic_access in place
// on all other files. So far. Use this.
//
   if is_home() {
{
   remove_action(&#38;#39;thematic_header&#38;#39;,&#38;#39;thematic_access&#38;#39;,9);
   }
} // close the function
//
  // Take action
  // FYI substituting wp_head for template_redirect &#38;quot;works&#38;quot;
  // but seems to bog down the loading of the site
  // Here&#38;#39;s what works now
//
     add_action(&#38;#39;template_redirect&#38;#39;,&#38;#39;remove_access&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Onward!&#60;/p&#62;
&#60;p&#62;Val
&#60;/p&#62;</description>
</item>
<item>
<title>flick on "Conditionally Removing thematic_access"</title>
<link>http://themeshaper.com/forums/topic/conditionally-removing-thematic_access#post-10465</link>
<pubDate>Fri, 05 Mar 2010 00:45:31 +0000</pubDate>
<dc:creator>flick</dc:creator>
<guid isPermaLink="false">10465@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;@Gene: Thanks for the correction :) I should have checked the tag before posting. Luckily it seems I can still edit the post so I've changed it in case someone does a straight copy/paste in the future.&#60;/p&#62;
&#60;p&#62;/me needs to investigate action hooks more.
&#60;/p&#62;</description>
</item>
<item>
<title>em hr on "Conditionally Removing thematic_access"</title>
<link>http://themeshaper.com/forums/topic/conditionally-removing-thematic_access#post-10463</link>
<pubDate>Fri, 05 Mar 2010 00:36:19 +0000</pubDate>
<dc:creator>em hr</dc:creator>
<guid isPermaLink="false">10463@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi Val,&#60;/p&#62;
&#60;p&#62;I've run into this as well. It was hard for me hard to wrap my head around it at first. The problem is that by hooking into &#60;code&#62;init&#60;/code&#62; the conditional tags will always return false. Basically, &#60;code&#62;init&#60;/code&#62; fires too soon. Try hooking into &#60;code&#62;template_redirect&#60;/code&#62; and your function will work the way you've intended it.&#60;/p&#62;
&#60;p&#62;Look to the codex for more info on action hooks: &#60;a href=&#34;http://codex.wordpress.org/Plugin_API/Action_Reference&#34; rel=&#34;nofollow&#34;&#62;http://codex.wordpress.org/Plugin_API/Action_Reference&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;@ Flick - Good call :) ...but the proper conditional tag for both  &#34;blog&#34; and &#34;front page&#34; would be typed &#60;code&#62;is_front_page&#60;/code&#62; that missing underscore will throw an error for calling an undefined function.&#60;/p&#62;
&#60;p&#62;Cheers,&#60;br /&#62;
Gene
&#60;/p&#62;</description>
</item>
<item>
<title>flick on "Conditionally Removing thematic_access"</title>
<link>http://themeshaper.com/forums/topic/conditionally-removing-thematic_access#post-10462</link>
<pubDate>Thu, 04 Mar 2010 23:50:37 +0000</pubDate>
<dc:creator>flick</dc:creator>
<guid isPermaLink="false">10462@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Perhaps you can consider using &#60;code&#62;is_front_page&#60;/code&#62; instead?&#60;/p&#62;
&#60;p&#62;From what I've understood, if a static page is used, it's best to use &#60;code&#62;is_front_page&#60;/code&#62; because the &#60;code&#62;is_home&#60;/code&#62; looks for the 'blog' (or default index) page.&#60;/p&#62;
&#60;p&#62;Chris also provided an interesting piece of code &#60;a href=&#34;http://themeshaper.com/forums/topic/is-this-right-way-of-adding-page-template-to-display-posts-from-a-category#post-10224&#34;&#62;here&#60;/a&#62; using&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;if (is_page_template(&#38;#39;blog.php&#38;#39;))&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I haven't tested it myself, but perhaps it might be useful for you?&#60;/p&#62;
&#60;p&#62;-----------------------------------------------&#60;br /&#62;
&#60;strong&#62;EDIT following Gene's post: corrected is_front_page&#60;/strong&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>Val on "Conditionally Removing thematic_access"</title>
<link>http://themeshaper.com/forums/topic/conditionally-removing-thematic_access#post-10459</link>
<pubDate>Thu, 04 Mar 2010 23:38:14 +0000</pubDate>
<dc:creator>Val</dc:creator>
<guid isPermaLink="false">10459@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;I created home.php and uploaded to my child theme directory.&#60;/p&#62;
&#60;p&#62;I can conditionally add stylesheets to the head by checking if is_home() is true.&#60;br /&#62;
I can conditionally add a &#34;welcome&#34; message in the header section.&#60;br /&#62;
But I cannot conditionally remove thematic_access.&#60;br /&#62;
It's all or nothing: I can remove it unconditionally, only.&#60;/p&#62;
&#60;p&#62;Any ideas as to why this code does not work?&#60;br /&#62;
[code]&#60;br /&#62;
// remove thematic_access()&#60;br /&#62;
function remove_access() {&#60;br /&#62;
	if (is_home()) {&#60;br /&#62;
	remove_action('thematic_header','thematic_access',9);&#60;br /&#62;
	}&#60;br /&#62;
}&#60;br /&#62;
add_action('init', 'remove_access');&#60;br /&#62;
[code]&#60;/p&#62;
&#60;p&#62;Thank you!
&#60;/p&#62;</description>
</item>

</channel>
</rss>
