Posted: June 10, 2015 at 1:31 pm
|
I am building a new site here http://hindsanchez.seequsdev.com/blog/ and we are using EE4. We are pulling upcoming events into our blog pages sidebar usign: It is working great on the main blog page and pages http://hindsanchez.seequsdev.com/blog/page/2/ through http://hindsanchez.seequsdev.com/blog/page/5/. On http://hindsanchez.seequsdev.com/blog/page/6/ it now only shows 2 events instead of the 3 it is set at. And from page7 http://hindsanchez.seequsdev.com/blog/page/7/ on it doesn’t pull in any events. Any idea why this is happening and how we can fix it? Also, it seems that every page shows 3 different events. Is this a setting that I can change? Thanks! |
Hi Melinda, The issues you’re seeing are from using the EE shortcode outside the main loop. It turns out the EE event list shortcode is intended to be placed within content that’s contained within the main loop (usually a WP page). What’s happening is the event list is catching the pagination request variables for the blog loop. So on each blog page, it’s paging through events too, until it runs out events! You can fix this by removing the call for do_shortcode() and instead, add a simple query to your sidebar template. The following code will follow everything you have set with the shortcode parameters, and allow for customizing the HTML output too: |
|
|
Awesome! Thank you so much! One other question. How do I get the tag links to show up under the 3 posts? The other code was pulling in tag links for each event like: Thanks! |
Hi Melinda, Are you sure that it wasn’t the theme’s code adding those? The reason I ask is because the [ESPRESSO_EVENTS] shortcode doesn’t normally output tags. More than likely it was being appended by either (a) a custom event template in your theme or (b) from the theme itself. A lot of themes will add a post meta section where it will display tags, which you can copy that code over to the new function or even re-use a template tag from the theme. For example the WordPress Twenty Fifteen theme has the twentyfifteen_entry_meta() template tag. |
|
|
I am pretty sure it was only the do shortcode pulling it in. I added the do shortcode version to my sidebar below the one using your code. The only code aside from the html structure is the do shortcode I showed you above Thanks! |
Hi Melinda, Have you looked at the code for the [ESPRESSO_EVENTS] shortcode and compared it with your theme? There is no code within the EE shortcode that lists out the tags. What’s happening is when the [ESPRESSO_EVENTS] shortcode is parsed, it starts a new WP loop, and your theme adds what it normally adds to a regular WP loop. Which includes the list of tags, and the pagination, which caused the issue you first reported. What you’ll need to do is look in your WP theme for how it lists out the tags. It may be a template tag or function that you’ll copy over to your sidebar template within the custom event list loop. |
|
|
I did look and found this code in the content-espresso_events.php file:
But it doesn’t pull in the tags for the posts. Can you see anything wrong in my code? |
Yes, where you have |
|
|
That fixed it!!!! Thank you so much for your help! You are a lifesaver! |
You’re welcome. |
|
The support post ‘Upcoming events aren't pulled into sidebar after page 6 in blog’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.