make events show on publish date in main blog view

Home Forums Calendar Products Events Calendar PRO make events show on publish date in main blog view

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #944333
    Doug
    Participant

    have I don’t this correctly? doesn’t seem to be working. I’m sure it’s my error. trying to get calendar event to show here http://fumchurch.com/general-news-2/

    <?php

    /**
    * Theme functions. Initializes the Vamtam Framework.
    *
    * @package wpv
    */

    require_once(‘vamtam/classes/framework.php’);

    new WpvFramework(array(
    ‘name’ => ‘church-event’,
    ‘slug’ => ‘church-event’
    add_action( ‘pre_get_posts’, ‘tribe_post_date_ordering’, 51 );
    function tribe_post_date_ordering( $query ) {
    if ( $query->tribe_is_multi_posttype) {
    remove_filter( ‘posts_fields’, array( ‘TribeEventsQuery’, ‘multi_type_posts_fields’ ) );
    $query->set( ‘order’, ‘DESC’ );
    }
    }
    ));

    // TODO remove next line when the editor is fully functional, to be packaged as a standalone module with no dependencies to the theme
    define (‘VAMTAM_EDITOR_IN_THEME’, true); include_once THEME_DIR.’vamtam-editor/editor.php’;

    #944405
    Gustavo Bordoni
    Keymaster

    Hi Doug,

    It seem that the code you provided is not a valid PHP, can you make sure you sent us the right code? To be able to help you further it would be awesome a small explanation of what you want to accomplish.

    To share the code here your best option is to use gist.github.com, then posting a link.

    My Best Regards,

    #944432
    Doug
    Participant
    #944438
    Gustavo Bordoni
    Keymaster

    Hi doug,

    As I said, the code you provided is not a valid PHP. What you want to accomplish here? And I can try to provide you with a solution.

    #944446
    Doug
    Participant

    I’m trying to get events to post as blog items; in the general news two category on the blog roll by posts date not by events date as stated below.

    this is the URL in question http://fumchurch.com/general-news-2/

    Order events in main blog loop by post date

    Under Events –> Settings –> General, you can set your events to show alongside your posts in the main blog loop on your site. By default, the events are ordered by the event date. This snippet allows you to change that, so events in the main blog loop are ordered by the date they were published.

    To do this, paste the following in your theme’s functions.php file. Please note that you may need to clear your cache to see the changes. If you need help using this snippet, feel free to post in our forums.
    1
    2
    3
    4
    5
    6
    7

    add_action( ‘pre_get_posts’, ‘tribe_post_date_ordering’, 51 );
    function tribe_post_date_ordering( $query ) {
    if ( $query->tribe_is_multi_posttype) {
    remove_filter( ‘posts_fields’, array( ‘TribeEventsQuery’, ‘multi_type_posts_fields’ ) );
    $query->set( ‘order’, ‘DESC’ );
    }
    }
    Details

    Categories: List View
    Level: Intermediate
    Products: The Events Calendar
    Last Updated: 9.10.14

    Related Articles

    Listing events with your site’s blog posts

    Report an issue
    Buy Events Calendar Pro
    Check out our Ticketing Solutions

    #944798
    Gustavo Bordoni
    Keymaster

    Hi Doug,

    I’ve made a small change on the code provided to you, this should help you fix the issue, if not please reply here and I will try to work it out with you.

    https://gist.github.com/bordoni/0e3dd416cfe673ad6d8a

    Place this on your functions.php file.

    My Best Regards,

    #946184
    Doug
    Participant

    I implemented this code as you suggested and it crashed the site with this error.

    Fatal error: Call to undefined function wpv_is_reduced_response() in /home/first1st/public_html/wp-content/themes/church-event/page.php on line 9

    I’ve put the default code back for the time being.

    #946282
    Gustavo Bordoni
    Keymaster

    Hi Doug,

    Can you paste how your functions.php file was after you pasted the snippet there?

    My Best Regards,

    #946913
    Doug
    Participant
    #946915
    Doug
    Participant
    #957534
    Gustavo Bordoni
    Keymaster

    Hi Doug,

    Since I never heard back from you with the requested information I will close this thread, if the problem arises again please open a new topic and someone from our team will assist you.

    my Best Regards,

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘make events show on publish date in main blog view’ is closed to new replies.