add_filter( ‘aioseo_canonical_url’, ‘aioseo_filter_canonical_url’ ); function aioseo_filter_canonical_url( $url ) { if (strpos($_SERVER[‘REQUEST_URI’],’/home-search/listing/’) !== false) { $url = home_url( $_SERVER[‘REQUEST_URI’] ); if (strpos($url,’?’) !== false){ $url = substr( $url, 0, strpos($url,’?’) ); } } return $url; }Continue reading
add_filter( ‘aioseo_description’, ‘aioseo_filter_description’ ); function aioseo_filter_description( $description ) { if ( strlen($description) > 160 ) { $description = substr($description, 0, 159); } return $description; }Continue reading
add_filter( ‘aioseo_title’, ‘aioseo_filter_title’ ); function aioseo_filter_title( $title ) { if ( strlen($title) > 60 ) { $title = substr($title, 0, 60); } return $title; }Continue reading
add_action( ‘init’, function() { if ( function_exists( ‘aioseo’ ) ) { aioseo()->preUpdates->createCacheTable(); } });Continue reading
add_filter( ‘aioseo_schema_woocommerce_shipping_disable’, ‘__return_true’ );Continue reading
// Custom PHP Code by Tyler (TITLE) function page_title_sc( ){ return get_the_title(); } add_shortcode( ‘page_title’, ‘page_title_sc’ ); // Enable Shortcode Execution in Text Widgets add_filter( ‘widget_text’, ‘do_shortcode’ ); // Disable Gutenberg Editor (use Classic Editor) add_filter(‘gutenberg_can_edit_post’, ‘__return_false’, 5); add_filter(‘use_block_editor_for_post’, ‘__return_false’,…Continue reading
add_filter( ‘body_class’, function( $classes ) { $user = wp_get_current_user(); $roles = $user->roles; return array_merge( $classes, $roles ); } );Continue reading
add_filter(‘body_class’, ‘stw_add_cart_status_class’); function stw_add_cart_status_class($classes) { if (function_exists(‘WC’)) { $cart = WC()->cart; if (isset($cart) && is_callable(array($cart, ‘get_cart_contents_count’))) { $items = $cart->get_cart_contents_count(); $classes[] = $items?’cart_has_items’:’cart_is_empty’; } } return $classes; }Continue reading
function filter_woocommerce_cart_item_class( $string, $cart_item, $cart_item_key ) { // Get the product categories slugs for this item $term_slugs = wp_get_post_terms( $cart_item[‘product_id’], ‘product_cat’, array( ‘fields’ => ‘slugs’ ) ); // NOT empty if ( ! empty ( $term_slugs ) ) { $string…Continue reading
//shortcode for total of items in cart – no shipping/taxes/etc. add_shortcode( ‘quote-total’, ‘get_quote_total’ ); function get_quote_total(){ $total = WC()->cart->total; return wc_price($total); }Continue reading