Add Custom Element to Breadcrumbs

add_filter( ‘aioseo_breadcrumbs_trail’, function( $crumbs ) { if(is_singular(‘post’) || is_category()){ $blog = [ ‘label’ => ‘Resources’, ‘link’ => ‘https://whatisnosy.com/resources’, ‘type’ => ” ]; array_splice( $crumbs, 0, 0, [$blog] ); } return $crumbs; }, 10, 2);Continue reading

FXBot – Add language code to external link

function append_language_to_external_links($content) { // Get the current language of your blog $current_language = apply_filters( ‘wpml_current_language’, NULL ); if ($current_language == “en”){ $current_language = “”; } // Create a DOMDocument instance to parse the content $dom = new DOMDocument(); libxml_use_internal_errors(true); //…Continue reading

Exclude All Posts of a Category from News Sitemap

add_filter( ‘aioseo_sitemap_exclude_posts’, ‘aioseo_sitemap_filter_excluded_posts’, 10, 2 ); function aioseo_sitemap_filter_excluded_posts( $ids, $type ) { if ( ‘news’ === $type ) { $category_id = 136; $posts_in_category = get_posts(array( ‘category’ => $category_id, ‘numberposts’ => -1, ‘fields’ => ‘ids’ )); $ids = array_merge($ids, $posts_in_category); }…Continue reading

theme setup unocss assets

if ( ! function_exists( ‘theme_setup_unocss_assets’ ) ) : function theme_setup_unocss_assets() { wp_enqueue_style( ‘unocss-reset’, ‘https://unpkg.com/@unocss/reset/tailwind.css’, array(), null ); wp_enqueue_script( ‘unocss-preset-uno’, ‘https://unpkg.com/@unocss/runtime/uno.global.js’, array(), null, true ); wp_enqueue_script( ‘unocss-preset-icons’, ‘https://unpkg.com/@unocss/runtime/preset-icons.global.js’, array(), null, true ); wp_add_inline_script( ‘unocss-preset-icons’, ‘window.__unocss = { presets: [ () =>…Continue reading

Display Product Dimensions Data

add_action( ‘woocommerce_single_product_summary’, ‘display_product_formated_dimensions_table’, 25 ); function display_product_formated_dimensions_table(){ global $product; if ( $product->has_dimensions() ) { echo ‘ ‘ . __( ‘Dimensions’, ‘woocommerce’ ) . ‘ ‘ . esc_html( wc_format_dimensions( $product->get_dimensions( false ) ) ) . ‘ ‘; } }Continue reading