I have a custom walker set up in Wordpress:
class Custom_Walker_Nav_Menu extends Walker_Nav_Menu {
function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) {
if ( $depth )
$indent = str_repeat("\t", $depth);
else
$indent = '';
extract($args, EXTR_SKIP);
$linkName = apply_filters( 'the_title', $item->post_title, $page->ID );
$output .= $indent . '<li id="item_'.$item->ID.'"><a href="#" class="'.strtolower($linkName).'" data-filter=".'.strtolower($linkName).'">'.$linkName.'</a>';
}
function end_el(&$output, $page, $depth = 0, $args = array()) {
$output .= "</li>
";
}
}
Which outputs the following:
<nav role="navigation">
<ul class="simple-nav">
<li id="item_15"><a href="#" class="home" data-filter=".home">HOME</a></li>
<li id="item_38"><a href="#" class="directing" data-filter=".directing">DIRECTING</a></li>
<li id="item_40"><a href="#" class="compositing" data-filter=".compositing">COMPOSITING</a></li>
<li id="item_42"><a href="#" class="visuals" data-filter=".visuals">VISUALS</a></li>
<li id="item_74"><a href="#" class="contact" data-filter=".contact">CONTACT</a></li>
</ul>
</nav>
The data-filter
attributes are used by Isotope to filter my results. This works well for the directing, compositing and visuals links.
However for the first link, I would like to attach data-filter=".all"
rather than .home
And for the last link, I want this to be an actual link to another page, rather than a blank link #
.
How can I add further customisation to these links specifically?
Thanks