• Resolved hwuser

    (@hwuser)


    Hello! I want to modify the query of the archive page, so that it shows the events of several categories (not all).
    I have seen two functions, and I wanted to know about the best practices, which of the two to use:
    Option 1:
    add_filter( ‘tribe_events_views_v2_view_repository_args’,…
    (This option has worked well for me.)

    Option 2:
    add_action( ‘pre_get_posts’,
    (This option does not work for me because it seems that the query in the main query does not modify the result…)

    Greetings and thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @hwuser,

    It’s great that you’ve already explored some solutions!

    Based on our knowledge base, here’s what we recommend:

    Option 1: Using add_filter(‘tribe_events_views_v2_view_repository_args’)

    This is the recommended approach for modifying the Events Calendar archive page query. It’s specifically designed to target the Events Calendar’s internal logic for building those views.

    We’re happy to hear this option has worked well for you!

    Option 2: Using add_action(‘pre_get_posts’)

    While add_action(‘pre_get_posts’) is a general WordPress action hook for modifying queries, it might not always be the most reliable approach for specifically targeting The Events Calendar queries.

    Plugin Support Darian

    (@d0153)

    Hi there,

    It appears that we haven’t heard back from you in a while, so I’ll assume that the matter has been resolved. If you need any more help, feel free to start a new thread and we’ll be happy to assist you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Modify query on archive page’ is closed to new replies.