__( 'Login Menu' ),
'quicklink-menu' => __( 'Quicklink Menu' ),
'main-menu' => __( 'Main Menu' ),
'side-menu' => __( 'Side Menu' ),
'newsletter-menu' => __( 'Newsletter Menu' )
)
);
}
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
}
add_action( 'widgets_init', 'my_register_sidebars' );
function my_register_sidebars() {
/* Register the 'primary' sidebar. */
register_sidebar(
array(
'id' => 'primary',
'name' => __( 'Primary' ),
'description' => __( 'Sidebar' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
)
);
}
add_filter( 'getarchives_where', 'customarchives_where' );
add_filter( 'getarchives_join', 'customarchives_join' );
function customarchives_join( $x ) {
global $wpdb;
return $x . " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)";
}
function customarchives_where( $x ) {
global $wpdb;
$category_child_list = get_categories('child_of=4');
$new_cat = array();
foreach ($category_child_list as $cat)
{
$new_cat[] = $cat->cat_ID;
}
array_push($new_cat,"4"); //insert parent_id 4 into array
$include = implode(', ',$new_cat); // category id to include
return $x . " AND $wpdb->term_taxonomy.taxonomy = 'category' AND $wpdb->term_taxonomy.term_id IN ($include)";
//$exclude = '1'; // category id to exclude
//return $x . " AND $wpdb->term_taxonomy.taxonomy = 'category' AND $wpdb->term_taxonomy.term_id NOT IN ($exclude)";
}
function pa_category_top_parent_id ($catid) {
while ($catid) {
$cat = get_category($catid); // get the object for the catid
$catid = $cat->category_parent; // assign parent ID (if exists) to $catid
// the while loop will continue whilst there is a $catid
// when there is no longer a parent $catid will be NULL so we can assign our $catParent
$catParent = $cat->cat_ID;
}
return $catParent;
}
// Puts link in excerpts more tag
function new_excerpt_more($more) {
global $post;
return ' Read the full article...';
}
add_filter('excerpt_more', 'new_excerpt_more');