• I just realized that pagination isn’t working anymore. I don’t really know when this started though. I looked around the internet and some users seem to have similar problems but none of their presented solutions helped solve my problem.

    The link I provided is to the page where the problem occurs directly. I use shortcode on that page.

    If it’s ok with the forum rules I would like to ask another question (if it’s not ok please ignore!): How can I write shortcode that shows events for the current year but only to the given date. For example: If I open the page on June 23 I see nothing but events from January 01 through June 23 of that year. Is that possible? I couldn’t find out how.

    Thank you!

    The page I need help with: [log in to see the link]

Viewing 14 replies - 1 through 14 (of 14 total)
  • Here’s the documentation on the search attributes for the events list: https://wp-events-plugin.com/documentation/event-search-attributes/

    [events_list pagination=1 scope="2024-01-01,2024-06-23"]
    Thread Starter saotome

    (@saotome)

    Thank your for your answer! And sorry for my terrible explanation of what I am trying to accomplish. Maybe this makes it clearer… I look for the outcome one would expect from

    [events_list pagination=1 scope="2024-01-01,today"]

    Which unfortunately doesn’t work… at least not when I tried.

    Thank you!

    Add the following code snippet to create your own shortcode to do that:

    add_shortcode('my_events_list', function( ) {
        $year = date("Y");
        $begin_of_year = new DateTime("$year-01-01");
        $start = $begin_of_year->format('Y-m-d');
        $today = new DateTime('now');
        $today->setTime(23, 59, 59);
        $end = $today->format('Y-m-d');
        return do_shortcode('[events_list pagination=1 scope="' . $start . ',' . $end . '"]');
    } );

    You can use the Code Snippets plugin to add this code snippet.

    On your page you would use the [my_events_list] shortcode.

    Remove the following line if you don’t want today’s events to be included in the results:

    $today->setTime(23, 59, 59);
    • This reply was modified 9 months, 2 weeks ago by joneiseman.
    Thread Starter saotome

    (@saotome)

    Thank you so much!

    Unfortunately I must be missing the knowledge to set this up properly. Somehow the shortcode works but it doesn’t return the expected list of events, it just shows “[events_list pagination=1 scope=”2024-01-01,2024-02-29″]”. I am very sorry to steal your time but would you be able to help me find out what I am doing wrong? I’ve tried for hours now… but I am just too stupid!

    https://interpenetration.net/archive-2024/

    Thanks!

    • This reply was modified 9 months, 1 week ago by saotome.

    I’m sorry but I’m not able to help you with getting that to work.

    If you have successfully added and activated the code snippet then the shortcode you should add is [my_events_list] (not [events_list pagination=1 scope=”2024-01-01,2024-02-29″]).

    Thread Starter saotome

    (@saotome)

    That’s what I did. I added [my_events_list]. The page then does not show the list of events but “[events_list pagination=1 scope=”2024-01-01,2024-02-29″]”. Which means that somehow it works because it actually shows today’s date.

    But if you’re not able to help I won’t bother you any longer. Thank you for your help up to this point. It is VERY appreciated!

    Plugin Support angelo_nwl

    (@angelo_nwl)

    with regards to the pagination, I escalated this to the Devs. should get fixed soon

    Thread Starter saotome

    (@saotome)

    Awesome! Thank you!

    Thread Starter saotome

    (@saotome)

    I finally had time to look into this again and found out that for whatever reason one of the brackets in the shortcode had transformed into its html number. Since I did nothing but copy-pasting it I never checked the code itself…

    Now everything works. Thank you again!

    In case joneiseman or someone with the knowledge sees this… How can I change the order of the events? I want the most recent event first… (and i am talking about changing it when using joneiseman’s shortcode!)

    Thank you!

    • This reply was modified 9 months, 1 week ago by saotome.

    Add order=”desc” to the shortcode. Change this line in the code snippet:

    return do_shortcode('[events_list pagination=1 scope="' . $start . ',' . $end . '"]');

    To this:

    return do_shortcode('[events_list pagination=1 order="desc" scope="' . $start . ',' . $end . '"]');
    • This reply was modified 9 months, 1 week ago by joneiseman.
    Thread Starter saotome

    (@saotome)

    OH! Thank you for the SUPER quick answer!

    So the order is important, I see. I had “order=”desc”” but had put it at the end of that line.. which didn’t work.

    Thank you so much!

    The order doesn’t matter. It must have been something else that prevented it from working.

    Thread Starter saotome

    (@saotome)

    Ok, thanks for letting us know!

    It’s working now!

    Thank you again!

    • This reply was modified 9 months, 1 week ago by saotome.
Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Pagination broken?’ is closed to new replies.