Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter samster91

    (@samster91)

    Hi Caroline,
    I’ve finally find out the problem after many hours of digging into the code.. so, the responsible function is axiom_query_add_posts_per_page declared into fw/core/core.wp.php specifically when it calls the function axiom_get_template_page_id(‘archive’): this function seems to mess up everyting about the events loaded.

    I’ve found a work around by adding a condition as follow:
    if ($query->is_archive()) {
    if ($query->get(‘post_type’)==’tribe_events’){
    require ABSPATH.’wp-content/plugins/the-events-calendar/src/Tribe/Query.php’;
    $args = array (
    ‘eventDisplay’ => $query->tribe_is_past?’past’:$query->get(‘eventDisplay’),
    ‘post_type’ => ‘tribe_events’,
    ‘post_status’ => array (‘publish’,’private’),
    ‘paged’ => $query->query_vars[‘paged’],
    ‘tribe_events_cat’ => $query->get(‘tribe_events_cat’)
    );
    Tribe__Events__Query::init();
    $query = Tribe__Events__Query::getEvents( $args, true );
    global $wp_query, $post, $paged;
    $wp_query = $query;
    if ( ! empty( $query->posts ) ) {
    $post = $query->posts[0];
    }
    } else{
    $page_id = axiom_get_template_page_id(‘archive’);
    }
    }

    replacing the old statement:

    if ($query->is_archive()) {
    $page_id = axiom_get_template_page_id(‘archive’);
    }

    first and last time 😉

    Thanks for the support provided.

    Thread Starter samster91

    (@samster91)

    Hello Caroline,
    the problem is actually in the Theme: I’ve installed Tavern by AxiomThemes bought through themeforest. I’ve discovered this when after switching to Twenty Sixteen everything worked fine.
    The problem is in the function ‘axiom_wp_theme_setup’ declared in the file fw/core/core.wp.php where the action ‘pre_get_posts’ call the function ‘axiom_query_posts_where’ that does something bad to the post list.
    But it’s not enaugh, infact, removing that line part of the problem still remain: specifically, in my case, the first post is not shown in the page.

    Can you provide me help in any way?

    Thanks.

    Thread Starter samster91

    (@samster91)

    Hi Caroline,
    I’ll try with the conflict testing steps right now and I’ll let you know!

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)