This will return the parent name of the current term being viewed of a custom taxonomy.
parent, get_query_var('taxonomy') ); echo $parent->name; ?>
This will return the parent name of the current term being viewed of a custom taxonomy.
parent, get_query_var('taxonomy') ); echo $parent->name; ?>
Going to have to try a few of these.
Scroll Path
SuperScrollorama
Stellar
Paralax Scrolling
Skroller
Can’t get enough of the flat design. Here is a great resource.
Go get the terms of a Custom Taxonomy that is associated with the current post and output them in a comma separated list.
ID, 'expertise', '
List terms in a given taxonomy using wp_list_categories
$taxonomy, 'orderby' => $orderby, 'show_count' => $show_count, 'pad_counts' => $pad_counts, 'hierarchical' => $hierarchical, 'title_li' => $title, 'hide_empty' => $empty ); ?>
Adds html to a div on hover and removes it when you mouseout. This was used to create a sort of tooltip for a navigation item.
$('li.nav-item').mouseenter(function() { $(this).append( "" ); }); $('li.nav-item').mouseleave(function() { $('.nav-message').remove(); });
A conditional if viewing a Custom Post Type
If you’re on
http://site.com/something/whatever-in-the-url/something-else/
Find, “#this-div” and remove everything in it.
$(function() { if ( document.location.href.indexOf('whatever-in-the-url') > -1 ) { $('#this-div').remove(); } });
jQuery to find url and add an “active” class to that navigation item.
$("[href]").each(function() { if (this.href == window.location.href) { $(this).addClass("active"); } });
The CSS to style the active class:
.active { color: #ccc; }
For Example:
If we had a Nav item like:
And we went to the About Page, we would see this:
What if you have an entire section that anytime you’re on that section the main nav is active?
// if I'm in "whatever-section" highlight my-main-nav-item. // example: http://mysite.com/whatever-section/a-page/ if(window.location.href.indexOf("whatever-section") > -1) { $('#main-nav .my-main-nav-item a').addClass("active"); }
In the functions file…
function is_tree($pid) { // $pid = The ID of the page we're looking for pages underneath global $post; // load details about this page if(is_page()&&($post->post_parent==$pid||is_page($pid))) return true; // we're at the page or at a sub page else return false; // we're elsewhere };
In the theme…
if (is_tree(8)) { //the number being the page ID // do stuff }