Home › Forums › Calendar Products › Events Calendar PRO › make events show on publish date in main blog view
- This topic has 10 replies, 2 voices, and was last updated 11 years ago by
Gustavo Bordoni.
-
AuthorPosts
-
February 23, 2015 at 10:01 am #944333
Doug
Participanthave 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’;February 23, 2015 at 3:03 pm #944405Gustavo Bordoni
KeymasterHi 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,
February 23, 2015 at 5:48 pm #944432February 23, 2015 at 6:17 pm #944438Gustavo Bordoni
KeymasterHi 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.
February 23, 2015 at 6:58 pm #944446Doug
ParticipantI’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
7add_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’ );
}
}
DetailsCategories: List View
Level: Intermediate
Products: The Events Calendar
Last Updated: 9.10.14Related Articles
Listing events with your site’s blog posts
Report an issue
Buy Events Calendar Pro
Check out our Ticketing SolutionsFebruary 25, 2015 at 8:53 pm #944798Gustavo Bordoni
KeymasterHi 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,
March 5, 2015 at 8:31 am #946184Doug
ParticipantI 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.
March 5, 2015 at 1:27 pm #946282Gustavo Bordoni
KeymasterHi Doug,
Can you paste how your functions.php file was after you pasted the snippet there?
My Best Regards,
March 9, 2015 at 8:06 am #946913Doug
ParticipantMarch 9, 2015 at 8:06 am #946915Doug
ParticipantApril 22, 2015 at 3:15 pm #957534Gustavo Bordoni
KeymasterHi 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,
-
AuthorPosts
- The topic ‘make events show on publish date in main blog view’ is closed to new replies.
