Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

251
Visualizações
Get Categories of events in Wordpress Events Calendar Pro Plugin

I'm using Events Calendar Pro plugin (https://theeventscalendar.com/product/wordpress-events-calendar-pro/) and I need to get all categories for each event.

I tried single_cat_title() and get_the_category() but they are not what I needed.

Actually, single_cat_title() function shows only the first category and get_the_category() returns empty array.

about 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

You can use following code to get details of each terms.

$cats = get_the_terms( $post_id, 'tribe_events_cat' );
$term = get_term( $cats[1], $taxonomy ); // Getting the 2nd term item
$name = $term->name; //Getting names of terms

More details from https://codex.wordpress.org/Function_Reference/get_term.

Let me know if you have further questions.

about 4 years ago · Santiago Trujillo Relatório

0

I tried single_cat_title() and get_the_category() but they are not what I needed.

get_the_category() function retrieves default categories, post categories. As the categories defined by Events calendar pro plugin is not default, you need to use get_the_terms() function.

In get_the_terms() function, you need to pass post_id as first parameter and taxonomy / category name.

So, wrapping all up you can try below code :-

$event_cats = get_the_terms( $post_id, 'tribe_events_cat' )

Let me know if you need further assistance...

about 4 years ago · Santiago Trujillo Relatório

0

You could try to make a copy of the event.php via the following path:

[your-theme] /tribe/events/v2/list/event.php

and then write the following there:

<?php foreach (get_the_terms(get_the_ID(), 'tribe_events_cat') as $cat) { echo $cat->name; } ?>

And then put it in span/p and styled it.

Inspired from: https://wordpress.stackexchange.com/questions/220511/correct-use-of-get-the-terms

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda