Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Custom wp_list_categories function WordPress

  • REFUNDED

Hi,

I'm looking for a solution to extend the wp_list_categories function possibly via a custom Walker?

Note that this is for a Custom Post Type and taxonomies and non-javascript solutions are preferred.

Categories with child categories must link to the first child category with the lowest ID otherwise do the default link.

For example, look at this page: http://www.lightyourway.co.za/turnstar/?categories=turnstiles

In the left sidebar menu, when you click on Turnstiles, you should be directed to the first child category (Full Height Industrial).

Cheers

Answers (1)

2013-02-03

Arnav Joy answers:

try this using jquery method

<script>
jQuery(document).ready(function($){
var href = $('#sidebarbox').find('ul.sidebarmenu').find('ul.children').find('li').eq(0).find('a').attr('href');

$('#sidebarbox').find('ul.sidebarmenu').find('ul.children').parent('li').find('a').attr('href', href);

});
</script>


barrycrous comments:

Hi Arnav,

Sorry, should have mentioned that we require non-javascript solutions.


barrycrous comments:

Hi Arnav,

Sorry, should have mentioned that we require non-javascript solutions.