-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference between back end and front end rendering using query loop #135
Comments
@phoopee3 Can you pull the latest version and check that this has been taken care of? There is a checkbox in settings that allows you to choose how you want to display dates. |
Sure I’ll take a look later today
jason
…On Sun, Jan 8, 2023, at 3:22 PM, Paul Barthmaier wrote:
@phoopee3 <https://github.com/phoopee3> Can you pull the latest version and check that this has been taken care of? There is a checkbox in settings <#220> that allows you to choose how you want to display dates.
—
Reply to this email directly, view it on GitHub <#135 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AADGF5ZRJNX4C2DH3KYJIM3WRMOZZANCNFSM6AAAAAAQBVUJCY>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
The query loop doesn't show the event date at all, and I don't know of a way to show it in the loop. |
I don't know what you mean here. I've looked at this using 2020 theme and things mostly work as expected. I do notice that using the Query Loop block, the GatherPress setting for showing dates isn't accounted for in the editor, but frontend works. Custom Query works as expected Query Loop Block |
add_shortcode('do-custom-event-loop', 'do_custom_event_loop' );
/**
* [do-custom-event-loop] Shortcode for Events
*
* @return string
*/
function do_custom_event_loop() {
$settings = GatherPress\Core\Settings::get_instance();
$use_event_date = ( $settings->get_value( 'gp_general', 'general', 'post_or_event_date' ) ? 'using Event Date' : 'using Post Date' );
$args = array(
'post_status' => 'publish',
'post_type' => 'gp_event'
);
$query = new WP_Query( $args );
ob_start();
echo '<h4 style="color:salmon">' . $use_event_date . '</h4>';
if ( $query->have_posts() ) {
echo '<ul class="category posts">';
while ( $query->have_posts() ) {
$query->the_post();
?>
<li <?php post_class( 'left' ); ?>>
<?php echo 'Post ID -- ' . $query->post->ID . ' = '; ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_title(); ?>
</a> | <?php the_date( 'F j, Y' );
echo ' |*no*format*| ' . the_date();
echo '<br>|| ' . get_the_date( 'Y F j', $query->post->ID );
echo '<br>|| ' . get_the_time( 'Y F j', $query->post->ID );
echo '<br>||| ' . get_the_date( 'F j, Y', $query->post->ID );
echo '<br>|||| ' . get_the_time('Y-m-d', $query->post->ID );
?>
</li>
<?php
}
echo '</ul>';
}
wp_reset_postdata();
$return_value = ob_get_clean();
return $return_value;
} |
@mauteri Seems to be an issue in editor for Query Loop blocks, but I wouldn't dig further into this for v1, unless we get someone with deep knowledge of React blocks. |
Query Loop block is probably not great for Events. Best to use the GatherPress block There might be a filter we can leverage in Query Loop (or one we can put a PR in for Gutenberg so it honors the filter that exists in the publish date filter), but the ordering is still by publish date, which you wouldn't want with events. We can leave this open, but I don't think there's anything actionable at this point. |
@carstingaxion I believe solved this with his Event Query Loop block variation. If you select |
That is correct. Take a look at the screen capture in my least recent comment at #599 (comment) |
WordPress v6.0.2
GatherPress v0.4.1
When using the query loop to display events, the date is not rendered correctly (it shows the post date, not the event date), and there is no excerpt show.
On the front end it shows the event date correctly (no time, but that's ok for now i think), and it shows the excerpt.
The text was updated successfully, but these errors were encountered: