Home › Forums › Free Themes › University Hub › Homepage Events — displaying future events?
- This topic has 1 reply, 2 voices, and was last updated 8 years, 9 months ago by wensolutions. 
- 
		AuthorPosts
- 
		
			
				
January 25, 2017 at 8:32 am #29867webmaster@govanquish.com ParticipantI see that the “events” section on the homepage is looking for Posts set to a specific category. However, it’s not possible to display future/upcoming events, since posts can only be public if they have already been published. Is there a way around this? Does us no good to display past events. January 25, 2017 at 11:38 pm #29923wensolutions KeymasterHello @webmaster@govanquish.com, The feature to get the future events to display in the Events section is not yet available in the theme. The date displayed in the Event section for the posts is actually the post publish date for the post selected in the section. However, you can get the feature by modifying the posts query and setting the posts to “Scheduled” with child theme approach. To know more about child theme, see the link here : https://codex.wordpress.org/Child_Themes You can also automate the task with the help of Child theme generator plugin. After creating and activating the child theme, paste in the following block of code in your child theme’s functions.php file : function university_hub_get_home_sections_options() { $choices = array( 'news-and-events' => array( 'label' => __( 'News and Events', 'university-hub' ), 'template' => 'template-news-and-events', ), 'call-to-action' => array( 'label' => __( 'Call To Action', 'university-hub' ), 'template' => 'template-parts/home/call-to-action', ), 'latest-news' => array( 'label' => __( 'Latest News', 'university-hub' ), 'template' => 'template-parts/home/latest-news', ), ); $output = apply_filters( 'university_hub_filter_home_sections_options', $choices ); return $output; }You will then need to create a new file “template-news-and-events.php” in your child theme’s directory and paste in the code below in the file : This will let you pull the posts set as “Scheduled” from your posts that will allow you to add future events in the Events listing. Hope this Helps, Best Regards !! 
- 
		AuthorPosts
- You must be logged in to reply to this topic.
 
	    




