Home › Forums › Calendar Products › Events Calendar PRO › All Events are sorted by Published Date, not Date of Event
- This topic has 8 replies, 3 voices, and was last updated 9 years, 11 months ago by
Support Droid.
-
AuthorPosts
-
April 7, 2016 at 1:02 pm #1099815
Abraham
ParticipantI had previously had a post on this: https://theeventscalendar.com/support/forums/topic/how-to-display-events-feed-by-date-of-event-not-published-date/
I mistakenly thought the issue was fixed. Some of the other issues we ran into were fixed, however, it’s still sorting event posts by date the post was published. It does not sort by Event Date.
To see the bug do as follows:
Visit this page: http://ocws.staging.tepia.co/events/
Use the Date picker to pick any date (Apr 1).I created an event today that is set for January 2017. Since it was most recently posted [today], it shows before the April 2016 and May 2016, etc.
How do I make the filter query event start dates instead of event post published date?
April 8, 2016 at 12:20 pm #1100201Geoff B.
MemberGood evening Abraham and welcome back!
Thank you for reaching out to us.
We are sorry to hear about the unfixed issue.
I would love to help you with this topic.To answer your question, the post published date should not even be considered in the query normally. Only the event date should be returned.
It does sound like you have some customization somewhere (probably in your WordPress theme) that’s causing this.
My first recommendations would be to:
- Open up the functions.php file of your WordPress theme and take a look for any function that seems related to this.
- Search the file for the string “date”
- Check if there is a /tribe-events/ folder in your WordPress theme
Let me know how that goes.
Best regards,
Geoff B.April 13, 2016 at 2:31 pm #1102156Abraham
ParticipantOur theme does have modifying files and I think you are on to something. There are a few different events plugins:
1. Events Maker (came with the theme, we disabled it) https://www.dfactory.eu/products/events-maker/
2. The Events Calendar
3. The Events Calendar ProIn the theme folder, there is a tribe-events folder but I appended ‘0’ to it and the problem persists.
The problem is corrected when I append a ‘0’ to either of these files (though it breaks some formatting):
/srv/www/ocws2.staging.tepia.co/public_html/wp-content/plugins/the-events-calendar/src/Tribe/Template/List.php/srv/www/ocws2.staging.tepia.co/public_html/wp-content/plugins/events-calendar-pro/src/Tribe/Templates/Week.php
Do these provide any insight as to what’s causing the issue? I can’t leave Week.php called Week.php0 or delete it.
April 13, 2016 at 10:28 pm #1102301Geoff B.
MemberGood evening Abraham,
Thank you for your answer.
Based on your findings, I would only recommend appending any file names as a solution as a very last resort.
That being said, I am pretty convinced that your theme (most likely in its functions.php file) is using the published post date a standard sorting criteria.
Would you mind temporarily reverting back to a default WordPress theme (such as twenty-fifteen) and see if the sorting is still by published date ?
Let me know how that goes.
Best regards,
Geoff B.April 14, 2016 at 11:19 am #1102631Abraham
ParticipantProblem persists with 2015 theme.
I had checked my funtions file and it looked fine.For reference, here is the functions.php file:
<?php
/**
* progression functions and definitions
*
* @package progression
* @since progression 1.0
*/if ( ! function_exists( ‘progression_setup’ ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which runs
* before the init hook. The init hook is too late for some features, such as indicating
* support post thumbnails.
*
* @since progression 1.0
*/function progression_setup() {
if(function_exists( ‘set_revslider_as_theme’ )){
add_action( ‘init’, ‘pro_ezio_custom_slider_rev’ );
function pro_ezio_custom_slider_rev() { set_revslider_as_theme(); }
}
add_action( ‘vc_before_init’, ‘progression_SetAsTheme’ );
function progression_SetAsTheme() { vc_set_as_theme( $disable_updater = true ); }// Post Thumbnails
add_theme_support( ‘post-thumbnails’ );
add_image_size(‘progression-blog’, 800, 350, true); // Blog Post Image
add_image_size(‘progression-wine’, 380, 830, false); // Wine Post Image
add_image_size(‘progression-event’, 600, 350, true); // Wine Post Image/**
* Make theme available for translation
* Translations can be filed in the /languages/ directory
* If you’re building a theme based on progression, use a find and replace
* to change ‘progression’ to the name of your theme in all the template files
*/
load_theme_textdomain( ‘progression’, get_template_directory() . ‘/languages’ );/**
* Add default posts and comments RSS feed links to head
*/
add_theme_support( ‘automatic-feed-links’ );/**
* Custom Widgets
*/
require( get_template_directory() . ‘/inc/widgets/widgets.php’ );/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( ‘title-tag’ );/**
* Enable support for Post Formats
*/
add_theme_support( ‘post-formats’, array( ‘gallery’, ‘video’, ‘audio’, ‘link’ ) );/**
* This theme uses wp_nav_menu() in one location.
*/
register_nav_menus( array(
‘primary’ => esc_html__( ‘Primary Menu’, ‘progression’ ),
) );}
endif; // progression_setup
add_action( ‘after_setup_theme’, ‘progression_setup’ );/**
* Set the content width based on the theme’s design and stylesheet.
*
* @since progression 1.0
*/
if ( ! isset( $content_width ) )
$content_width = 1200; /* pixels *//**
* Register widgetized area and update sidebar with default widgets
*
* @since progression 1.0
*/
function progression_widgets_init() {
register_sidebar( array(
‘name’ => __( ‘Sidebar’, ‘progression’ ),
‘description’ => ‘Default sidebar’,
‘id’ => ‘sidebar-1’,
‘before_widget’ => ‘<div id=”%1$s” class=”sidebar-item widget %2$s”>’,
‘after_widget’ => ‘</div><div class=”sidebar-divider-pro”></div>’,
‘before_title’ => ‘‘,
‘after_title’ => ‘‘,
) );register_sidebar( array(
‘name’ => __( ‘Footer Widgets’, ‘progression’ ),
‘description’ => __( ‘Footer widgets’, ‘progression’ ),
‘id’ => ‘footer-widgets’,
‘before_widget’ => ‘<div id=”%1$s” class=”widget-pro %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘‘,
‘after_title’ => ‘‘,
) );register_sidebar( array(
‘name’ => __( ‘Shop Sidebar’, ‘progression’ ),
‘description’ => ‘WooCommerce sidebar’,
‘id’ => ‘sidebar-shop’,
‘before_widget’ => ‘<div id=”%1$s” class=”sidebar-item widget %2$s”>’,
‘after_widget’ => ‘</div><div class=”sidebar-divider-pro”></div>’,
‘before_title’ => ‘‘,
‘after_title’ => ‘‘,
) );
}
add_action( ‘widgets_init’, ‘progression_widgets_init’ );/**
* Enqueue scripts and styles
*/
function progression_scripts() {
wp_enqueue_style( ‘progression-style’, get_stylesheet_uri() );
wp_enqueue_style( ‘google-fonts’, ‘http://fonts.googleapis.com/css?family=Crimson+Text:400,400italic,600,700|Lato:100,300,400,700’, array( ‘progression-style’ ) );
wp_enqueue_script( ‘plugins’, get_template_directory_uri() . ‘/js/plugins.js’, array( ‘jquery’ ), ‘20120206’, true );
wp_enqueue_script( ‘scripts’, get_template_directory_uri() . ‘/js/script.js’, array( ‘jquery’ ), ‘20120206’, true );
wp_enqueue_script( ‘google_maps’, ‘http://maps.google.com/maps/api/js?sensor=false’, 1 );
wp_enqueue_script( ‘gomap’, get_template_directory_uri() . ‘/js/jquery.gomap-1.3.3.min.js’, array( ‘jquery’ ), ‘20120206’, false );wp_enqueue_style( ‘prettyphoto’ );
if ( is_singular() && comments_open() && get_option( ‘thread_comments’ ) ) { wp_enqueue_script( ‘comment-reply’ ); }
}
add_action( ‘wp_enqueue_scripts’, ‘progression_scripts’ );/**
* Remove plugin scripts and styles
*/
function pro_deregisterstyles() {
wp_deregister_style( ‘flexslider’ );
wp_deregister_style( ‘font-awesome’ );
wp_deregister_script( ‘prettyphoto’ );
}
add_action( ‘wp_enqueue_scripts’, ‘pro_deregisterstyles’, 100 );/**
* Custom Editor Styles
*/
function progression_add_editor_styles() {
add_editor_style( ‘inc/editor-style.css’ );
}
add_action( ‘admin_init’, ‘progression_add_editor_styles’ );/**
* Custom template tags for this theme.
*/
require get_template_directory() . ‘/inc/template-tags.php’;/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . ‘/inc/extras.php’;/**
* Custom Metabox Fields
*/
require get_template_directory() . ‘/inc/Custom-Meta-Boxes/custom-meta-boxes.php’;/**
* Theme Customizer
*/
require get_template_directory() . ‘/inc/default-customizer.php’;/**
* Theme Customizer
*/
require get_template_directory() . ‘/inc/mega-menu/mega-menu-framework.php’;/**Change buttons on Events Details page – no longer requested
add_filter(‘tribe_get_event_website_link_label’, ‘tribe_get_event_website_link_label_default’);function tribe_get_event_website_link_label_default ($label) {
if( $label == tribe_get_event_website_url() ) {
$label = “Buy Tickets Now »”;
$class = “pro-button-shortcode event-btn default-style-pro small-size-pro tickets-button”;
}return ‘‘ . $label . ‘ ‘;
} *//**Hide items from Admin Menu */
add_action( ‘admin_menu’, ‘oc_remove_menus’, 999 );
function oc_remove_menus() {remove_menu_page( ‘edit-comments.php’ ); // Comments
remove_menu_page( ‘edit.php?post_type=wine’ ); //Wines}
/**
* WooCommerce Functions
*/
if ( ! function_exists( ‘woocommerce’ ) ) require get_template_directory() . ‘/inc/woocommerce-functions.php’;/**
* Load Plugin Activiation
*/
require get_template_directory() . ‘/inc/tgm-plugin-activation/plugin-activation.php’;/* Remove Password Strength Meter */
function wc_ninja_remove_password_strength() {
if ( wp_script_is( ‘wc-password-strength-meter’, ‘enqueued’ ) ) {
wp_dequeue_script( ‘wc-password-strength-meter’ );
}
}
add_action( ‘wp_print_scripts’, ‘wc_ninja_remove_password_strength’, 100 );/**
* Manipulate default state and countries
*
* As always, code goes in your theme functions.php file
*/
add_filter( ‘default_checkout_country’, ‘change_default_checkout_country’ );
add_filter( ‘default_checkout_state’, ‘change_default_checkout_state’ );function change_default_checkout_country() {
return ‘US’; // country code
}function change_default_checkout_state() {
return ‘CA’; // state code
}// Simply remove anything that looks like an archive title prefix (“Archive:”, “Foo:”, “Bar:”).
add_filter(‘get_the_archive_title’, function ($title) {
return preg_replace(‘/^\w+: /’, ”, $title);});
/**
* Disables the public attendee lists on all events
*
* Removes the tribe_events_single_event_after_the_meta action that injects the attendee
* list that was introduced with the initial 4.1 release of Event Tickets Plus
*/
function disable_attendee_list_on_post() {
if ( ! class_exists( ‘Tribe__Tickets_Plus__Attendees_List’ ) ) {
return;
}remove_action(
‘tribe_events_single_event_after_the_meta’,
array(
Tribe__Tickets_Plus__Attendees_List::instance(),
‘render’
),
4
);
}add_action( ‘wp’, ‘disable_attendee_list_on_post’ );
// Check the password and confirm password fields match before allow checkout to proceed.
add_action( ‘woocommerce_after_checkout_validation’, ‘wc_check_confirm_password_matches_checkout’, 10, 2 );
function wc_check_confirm_password_matches_checkout( $posted ) {
$checkout = WC()->checkout;
if ( ! is_user_logged_in() && ( $checkout->must_create_account || ! empty( $posted[‘createaccount’] ) ) ) {
if ( strcmp( $posted[‘account_password’], $posted[‘account_password2’] ) !== 0 ) {
wc_add_notice( __( ‘Passwords do not match.’, ‘woocommerce’ ), ‘error’ );
}
}
}add_action(“admin_menu”, “createMyMenus”);
function createMyMenus() {
add_users_page (“Export OCWS”, “Export OCWS”, 0 , “/api/?userExport=true” );
}April 14, 2016 at 9:01 pm #1102838Geoff B.
MemberHey Abraham,
Thank you for sharing your info. You are right, everything looks fine in the functions.php
At this point, the next step would be to go through our testing for conflicts procedure and let us know what you find out.
Basically the goal here is to revert back to a bare WordPress installation to see if the problem persists. It also allows us to pinpoint what the cause of the issue is.
There is a chance that a plugin might be interfering (e.g.: post types order)
Let me know how that goes.
Best regards,
Geoff B.April 18, 2016 at 9:02 pm #1104058Abraham
ParticipantGeoff,
I understand you are trying to help. But you are asking me to do what I’ve already done.
I’ve already identified that by disturbing the current nomenclature of the following files, the issue goes away, though it breaks some other functionality:
/srv/www/ocws2.staging.tepia.co/public_html/wp-content/plugins/the-events-calendar/src/Tribe/Template/List.php
/srv/www/ocws2.staging.tepia.co/public_html/wp-content/plugins/events-calendar-pro/src/Tribe/Templates/Week.php
I have provided server details in a previous thread that was closed prematurely by another support agent. Can I give it to you again? Will you help me please?
April 19, 2016 at 4:11 pm #1104592Geoff B.
MemberHey Abraham,
I totally understand where you are coming from.
And, as you pointed out, I am trying to help you figure out the cause of the issue.We fully appreciate what you have done so far and we are always interested in any help we can get in resolving undesired and unintentional issues.
You are right, changing the nomenclature of the files does help to solve your specific issue. However, as much as it’s a great investigation starting point, it doesn’t necessarily mean that these files are the cause (maybe they are, but there is also a chance that something calling these files might be the doing this – in a plugin or a theme for example).
I also realize you might have gone through the testing for conflicts in the previous thread. Please note that normally, we systematically ask to go through that procedure again whenever there is any change (such as WordPress upgrade, plugin and theme updates). Speaking of which, has there been any theme update since the last thread ?
I realize this might be cumbersome for you, but in my experience, it is absolutely worth leaving no stone unturned. It is by far the fastest way to reach resolution.
The other reason for that is because I was unable to reproduce the issue on my end, even after several attempts.
This is why, unless you can tell me you went through a theme update since the last conversation, going through the procedure and confirming if the issue is still there with a basic WordPress theme would and without any non-essential WordPress plugins would be the next logical step.
I wish I had a better answer for you, but for now it’s the best one I have.
Let me know how that goes.
Best regards,
Geoff B.May 4, 2016 at 9:35 am #1110556Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘All Events are sorted by Published Date, not Date of Event’ is closed to new replies.
