'ids', 'hide_empty' => 1, // We only need to know if there is more than one category. 'number' => 2, ) ); // Count the number of categories that are attached to the posts. $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'eighteen_tags_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so eighteen_tags_categorized_blog should return true. return true; } else { // This blog has only 1 category so eighteen_tags_categorized_blog should return false. return false; } } /** * Flush out the transients used in eighteen_tags_categorized_blog. */ function eighteen_tags_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'eighteen_tags_categories' ); } add_action( 'edit_category', 'eighteen_tags_category_transient_flusher' ); add_action( 'save_post', 'eighteen_tags_category_transient_flusher' ); /** * Call a shortcode function by tag name. * * @since 1.4.6 * * @param string $tag The shortcode whose function to call. * @param array $atts The attributes to pass to the shortcode function. Optional. * @param array $content The shortcode's content. Default is null (none). * * @return string|bool False on failure, the result of the shortcode on success. */ function eighteen_tags_do_shortcode( $tag, array $atts = array(), $content = null ) { global $shortcode_tags; if ( ! isset( $shortcode_tags[ $tag ] ) ) { return false; } return call_user_func( $shortcode_tags[ $tag ], $atts, $content, $tag ); } function wc_breadcrumb_register() { if ( ! function_exists( 'woocommerce_breadcrumb' ) ) { function woocommerce_breadcrumb() { global $post; $sep = " / "; // Simply change the separator to what ever you need e.g. / or > if ( ! is_front_page() ) { $home = '
Home ' . $sep; if ( is_category() || is_single() ) { echo $home; the_category( ', ' ); if ( is_single() ) { echo $sep; the_title(); } echo '
'; } elseif ( is_page() && $post->post_parent ) { echo $home; $home = get_page( get_option( 'page_on_front' ) ); for ( $i = count( $post->ancestors ) - 1; $i >= 0; $i -- ) { if ( ( $home->ID ) != ( $post->ancestors[ $i ] ) ) { echo ''; echo get_the_title( $post->ancestors[ $i ] ); echo "" . $sep; } } echo the_title(); echo ''; } elseif ( is_page() ) { echo $home . get_the_title() . ''; } elseif ( is_home() && ! is_front_page() ) { echo $home . get_the_title( get_option( 'page_for_posts' ) ) . ''; } elseif ( is_404() ) { echo "{$home}404"; } } } } } function eighteen_tags_add_notice( $notice, $key = null ) { $notices = get_theme_mod( '18-tags-notices', array() ); if ( $key ) { $notices[ $key ] = '

' . $notice . '

'; } else { $notices[] = '

' . $notice . '

'; } set_theme_mod( '18-tags-notices', $notices ); }