- This topic has 1 reply, 2 voices, and was last updated 7 years, 11 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › Free Themes › University Hub › Homepage Events — displaying future events?
I 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.
Hello @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 !!
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |