WordPress.org

Forums

My Calendar
How to limit # events displayed? (6 posts)

  1. bbq797
    Member
    Posted 2 years ago #

    Hi,

    I want to display "Today's Events", but I also want to limit how many events can be displayed at one time and just put a "see more" or "see full calendar" button after a certain number of events. Is this possible?

    Thanks!

    http://wordpress.org/extend/plugins/my-calendar/

  2. Joe Dolson
    Member
    Plugin Author

    Posted 2 years ago #

    Today's events doesn't have any kind of limitation - it just shows the events scheduled for today. Using CSS, you could employ something like

    #todays-events li:nth-child(-n+3) { display: none; }

    This would show the first 3 events of the list of events. Just change the number in the child expression to vary what you hide. You could add the 'see more' option using the :after pseudo-element.

    Best,
    Joe

  3. bbq797
    Member
    Posted 2 years ago #

    Thanks for your reply, appreciate it! Just another question (or two!)

    "You could add the 'see more' option using the :after pseudo-element."

    Sorry, new at learning CSS not sure what that means or where to place it.

    Also, if I change the css, does that mean anytime I use "today's events" it will always limit it? So the "see more" will have to display a full calendar, not the rest of the day's events.

    Thanks.

  4. Joe Dolson
    Member
    Plugin Author

    Posted 2 years ago #

    Yes, changing the CSS would always limit it. But you could get more complicated than that by using jQuery to hide/reveal elements. That's really getting into some fairly complicated customization, though - it's kind of beyond the basic support I can really provide.

    http://coding.smashingmagazine.com/2011/07/13/learning-to-use-the-before-and-after-pseudo-elements-in-css/

  5. erea77
    Member
    Posted 2 years ago #

    Did you ever get this to work @bbq797 ???

    I would like to do the exact same.

  6. erea77
    Member
    Posted 2 years ago #

    Never mind, I decided on another solution to my problem.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • My Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic