• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

96
Vistas
How to add a function only to woocommerce pages

I have this code I put in to remove part of my breadcrumbs in woocommerce which said "Products" in the second crumb:

if( $item_position === 2 ){continue;}

While it does work, it also removes the second breadcrumb from my other pages, while I just want it to remove it from woocommerce so I tried:

if ( is_woocommerce && $item_position === 2 ){continue;}

Which did the same as the previous, and I also tried:

if (is_woocommerce ($item_position === 2 ){continue;}

Which now works on my other pages but will completely remove breadcrumbs from woocommerce. I'm just learning and I have no idea what i'm doing wrong.

almost 3 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

is_woocommerce() is a function.

The correct syntax is:

if (is_woocommerce() && $item_position === 2 ) { 
    continue; 
}
almost 3 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda