No se han encontrado widgets en la barra lateral

Yoast seo bradcrumbs codigo

if ( function_exists('yoast_breadcrumb') ) {yoast_breadcrumb( '<p id="breadcrumbs">','</p>' ); }

Leer más

Obtener el post_content usando un id de post

$post = get_post(12); // specific post $the_content = apply_filters('the_content', $post->post_content); if ( !empty($the_content) ) { echo $the_content; }

Leer más

Obtener el id de la pagina de posts

Para obtener este id, se utiliza el siguoiente código: $page_for_posts = get_option( 'page_for_posts' );

Leer más

Crear usuario y base de datos comando

Paso 1 - Acceder a mysql como root mysql -u root Paso 2 - Crear la base de datos. CREATE DATABASE db_name; Paso 3 - Crear el usuario con contraseña…

Leer más

Agregar ACF de imágenes en el menú

add_filter('wp_nav_menu_objects', 'my_wp_nav_menu_objects', 10, 2); function my_wp_nav_menu_objects( $items, $args ) { foreach( $items as &$item ) { $icon = get_field('icono', $item); if( $icon ) { $item->title .= ' ';} } return…

Leer más

Obtener Wishlist por usuario

/** * @param int $customerId */ public function getWishlistByCustomerId($customerId) { $wishlist = $this->wishlist->loadByCustomerId($customerId)->getItemCollection(); return $wishlist; } getWishlistByCustomerId($customerId); if(count($wishlistCollection)) { foreach ($wishlistCollection as $_item) { /* You can get ID, Name,…

Leer más

Quitar regiones al state field del checkout woocommerce

add_filter( 'woocommerce_states', 'custom_us_states', 10, 1 ); function custom_us_states( $states ) { $non_allowed_us_states = array( 'CL-AI', 'CL-AN', 'CL-AP', 'CL-AR', 'CL-AT', 'CL-BI', 'CL-CO', 'CL-LI', 'CL-LL', 'CL-LR', 'CL-MA', 'CL-ML', 'CL-NB', 'CL-TA', 'CL-VS'); //…

Leer más

Actualizar el contador del carrito, cuando se usa ajax

function update_cart_count($fragments) { $link = '<li id="shopping-cart-header" class="float-left"><a href="' . get_permalink(9) . '"><i class="fas fa-shopping-cart"></i>&nbsp;' . WC()->cart->get_cart_contents_count() . ' Mi carro</a></li>'; $fragments['li#shopping-cart-header'] = $link; return $fragments; } add_filter('woocommerce_add_to_cart_fragments', 'update_cart_count');

Leer más