View difference between Paste ID: ztTGHAKd and u2FvVhSF
SHOW: | | - or go back to the newest paste.
1
<?php
2-
add_action( 'wp', 'the_debug_function' );
2+
3
// Shortcode for displaying children of a category in a horizontal list
4
5
function horizontal_category_func( $parent, $content = null ) {
6
// debug to check if function is being called 
7
 //exit("I've been hit!");
8
	extract(shortcode_atts(array(
9-
 exit("I've been hit!");
9+
10
	), $parent));
11
	
12
	$slug = $parent->slug;
13
	$cat_name = get_the_category_by_ID( $parent );
14
	$cat_title = "<h3><a href=\"category/$slug\">$cat_name</a></h3>";
15
	echo=0;
16
	$cat_list = wp_list_categories( "child_of=$parent&show_count=1&title_li=$cat_title" );
17
	
18
	return $cat_list;
19
}
20
21
add_shortcode( 'horizontal_category', 'horizontal_category_func' );