term_id ) ) {
if ( get_woocommerce_term_meta( $queried_object->term_id, 'thumbnail_id', true ) ) {
$classes[] = 'term-has-image';
} else {
$classes[] = 'term-missing-image';
}
}
// Add class if we're on an empty cart
if ( is_cart() && WC()->cart->get_cart_contents_count() == 0 ) {
$classes[] = 'viewing-empty-cart';
}
// Add class if we're on the account page and not logged in
if ( ( is_account_page() && ! is_user_logged_in() ) || is_wc_endpoint_url( 'lost-password' ) ) {
$classes[] = 'account-form';
// Lost password = single form
if ( is_wc_endpoint_url( 'lost-password' ) ) {
$classes[] = 'single-account-form';
// If the form query argument is set, add class indicating which form is visible
} elseif ( isset( $_GET['form'] ) && get_option( 'woocommerce_enable_myaccount_registration' ) === 'yes' ) {
$classes[] = 'single-account-form';
if ( $_GET['form'] == 'registration' ) {
$classes[] = 'showing-registration-form';
} else {
$classes[] = 'showing-login-form';
}
// If not, we're either showing one or both forms, depending on the WooCommerce registration setting
} else {
if ( get_option( 'woocommerce_enable_myaccount_registration' ) === 'yes' ) {
$classes[] = 'both-account-forms';
} else {
$classes[] = 'single-account-form';
}
}
}
return $classes;
}
add_action( 'body_class', 'sullivan_woo_body_classes', 1 );
} // End if().
/* ---------------------------------------------------------------------------------------------
ADD FORGOTTEN PASSWORD AND REGISTRATION LINKS TO LOGIN FORM
--------------------------------------------------------------------------------------------- */
if ( ! function_exists( 'sullivan_woo_add_login_footer' ) ) {
function sullivan_woo_add_login_footer() {
?>
is_search && ! is_admin() ) {
$woocommerce_pages = sullivan_woo_get_woocommerce_pages();
$query->set( 'post__not_in', $woocommerce_pages );
}
return $query;
}
add_filter( 'pre_get_posts', 'sullivan_woo_exclude_wc_pages_in_search' );
}
/* ---------------------------------------------------------------------------------------------
GET WOOCOMMERCE PAGES
--------------------------------------------------------------------------------------------- */
if ( ! function_exists( 'sullivan_woo_get_woocommerce_pages' ) ) {
function sullivan_woo_get_woocommerce_pages() {
$woocommerce_pages = array(
get_option( 'woocommerce_shop_page_id' ),
get_option( 'woocommerce_cart_page_id' ),
get_option( 'woocommerce_checkout_page_id' ),
get_option( 'woocommerce_myaccount_page_id' ),
get_option( 'woocommerce_edit_address_page_id' ),
get_option( 'woocommerce_view_order_page_id' ),
get_option( 'woocommerce_change_password_page_id' ),
get_option( 'woocommerce_logout_page_id' ),
);
return $woocommerce_pages;
}
add_filter( 'pre_get_posts', 'sullivan_woo_get_woocommerce_pages' );
}
/* ---------------------------------------------------------------------------------------------
ADJUST WOOCOMMERCE BREADCRUMBS
--------------------------------------------------------------------------------------------- */
if ( ! function_exists( 'sullivan_woo_breadcrumbs_arguments' ) ) {
function sullivan_woo_breadcrumbs_arguments( $args ) {
$args['delimiter'] = '';
$args['wrap_before'] = '