Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

59
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.

7 months 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; 
}
7 months 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 empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.