• Resolved osolemiobaby

    (@osolemiobaby)


    Hey there!

    I have a problem with the filterbar_items-Options: when I add filterbar_items=years_hlist(show_all=false|show_past=true) , the filter “all” is not shown, but the filter “past” is shown neither – though it should be, with the code posted above. When I use only show_past=true , the filter works. Any ideas how to solve this?

    In case you want to have a look at my page: http://www.tontraegerberlin.de/wordpress/?page_id=826 (I put in German translations by changing the code – I hope you don’t mind?)

    In the whole, I think it’s a minor problem – I love the plugin, it’s really usefull and easy to use, so thanks for that!

    https://wordpress.org/plugins/event-list/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author mibuthu

    (@mibuthu)

    Do you still have this problem. The code you gave above is working in my installation like expected.

    Thread Starter osolemiobaby

    (@osolemiobaby)

    Hey, thanks for the answer – yes, the problem is still there. I reactivated the filterbar now (took it away for a while now, since it didn’t do what I wanted it to do).

    Could I possibly have wrecked the code by entering my translations?

    Lennart

    Thread Starter osolemiobaby

    (@osolemiobaby)

    Same problem on this page, where I embeded the event list:

    http://www.tontraegerberlin.de/lennart/wordpress/?page_id=10

    Thread Starter osolemiobaby

    (@osolemiobaby)

    Okay, I found a solution:

    if(!isset($options['show_upcoming']) || 'true' == $options['show_upcoming']) {   // default is true
                            $elements[] = $this->upcoming_element();
                    }
                    if(isset($options['show_past']) && 'true' == $options['show_past']) {   // default is false
                            $elements[] = $this->past_element();

    In line 106, there’s missing a “!” before the “isset” and instead of “||” there’s “&&” – I’m not a coder, so I don’t know, what any of these signs mean, but I changed it and now it works.

    I hope, this is helping someone!

    Plugin Author mibuthu

    (@mibuthu)

    If you change line 106 like you have described above the default value is set to true. So also if you remove the show_past from the shortcode the Past entry should be visible then.
    But it should also work without this modification. It seems to be a problem that the options array isn’t set correctly.
    Can you give me your full shortcode please?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to use the year-filter without "all", but with "past"?’ is closed to new replies.