How could I know all the categories from post?
Your problem lies in this piece of code $categoriaActual = get_the_category($post->ID); $idCategoriaActual = $categoriaActual[0]->term_id; The first line gets the categories that belongs to the post in an array, that is fine (Just one note, when inside the loop, you don’t need to pass the post ID, that is done by default). Your second line of … Read more