WordPress.org

Ready to get started?Download WordPress

Forums

WP calendar and future events! Plugins don't give me what I need. (6 posts)

  1. maisteriharju
    Member
    Posted 5 years ago #

    Hi,

    I'm making an events website where the posts dated in future deliver the information of coming events. So far everything is working fine, I have the list of events but I would also like to have a "calendar view" option of those future posts. I know there are some event calendar plugins but they all are based on "add new event" function and they don't deal with the future posts at all. The posts and events are separated so to speak. If I use a plugin I need to add the event as a post and also as an event --> too much work. I know I could just use the plugin and forget the future posts but the event plugins don't support much of formatting of the events info. I need to add also images and complex formatted text to the events info and plugins dont support that.

    All I need to have is gregorian calendar view which shows future post titles as links inside the "day box". I mean something like this: http://www.nearlogic.com/wp-content/uploads/2007/02/event_calendar.png

    So is there any way make the basic WordPress calendar first of all show the future posts and second of all to show also the titles of future posts inside the calendar?

    I tried Future is now -plugin but it doesn't make the calendar show the future posts. And I have no idea how to get the post titles to show up.

    Thanks for help.

    - Tuomas

  2. maisteriharju
    Member
    Posted 5 years ago #

    For to make sure that someone doesn't get wrong idea: If you look at the nearlogic.com -link from my previous message, I just mean the table layout in that image. It doesn't have to be a popup window or anything like that.

    All I need to have is a calendar on a plain WordPress page which shows the topics/titles of the posts dated in future inside the "days" of the calendar. If you don't understand what I mean, pls tell me. I have to explain it in some other way then.

  3. maisteriharju
    Member
    Posted 5 years ago #

    I managed to get so far that I actually can see the future posts now in the basic WP calendar.

    Here is how I did it.

    I opened general-template.php to text editor and found place where it says: "// Get days with posts". Couple of lines below there is this code

    AND post_date <

    Little bit googling and I found appropriate code. So I changed it to this

    AND post_date !=

    This made the calendar to show hyperlinks to all posts - the posts in the past and posts in the future.

    Now I still needed to have the post topics show in the day box. For to get that I changed this code

    if ( in_array($day, $daywithpost) ) // any posts today?
    echo '<a href="' . get_day_link($thisyear, $thismonth, $day) .
    "\" title=\"$ak_titles_for_day[$day]\">$day</a>";

    to this:

    if ( in_array($day, $daywithpost) ) // any posts today?
    
    echo '<a href="' . get_day_link($thisyear, $thismonth, $day) .
    "\" title=\"$ak_titles_for_day[$day]\">$day</a>
    $ak_titles_for_day[$day]";

    But I still have a problem which I can't figure out. I have the titles now in the calendar but how can I make the WordPress change those titles to hyperlinks which lead to the post?

    Usually I'm pretty alone with these problems here but now I really hope someone would look at this code and tell me what kind of function adds the hyperlinks to those titles.

    $ak_titles_for_day[$day] seems to add the post titles to the calendar. Is it possible to change it somehow that it would change the titles to hyperlinks?

    Anyone?

  4. maisteriharju
    Member
    Posted 5 years ago #

    Anyone?

  5. maisteriharju
    Member
    Posted 5 years ago #

    Ok. I abandoned the whole idea of having the basic WP calendar show the info (links to the posts) because I'm seriously bad in writing PHP (read: don't know PHP at all).

    But got this new idea: a CALENDAR THEME! In the calendar theme all the headlines of posts would be presented inside calendar grid. There are three-column layouts and four column layouts so why can't there be 5-rows-and-7-columns calendar grid layout?!

    Only problem is that I can't do it either. I can't figure out how the wordpress would add empty space to the calendar when there aren't any posts for some particular day. And also how the posts would actually go to the right boxes. I suppose conditional tags aren't enough for that.

    Hmm... If you get some kicks out of this obviously amazing idea and know how to do it, pls let me now.

  6. BestofNJ.com
    Member
    Posted 5 years ago #

    Tuomas,

    The calendar theme is a great idea. Maybe you could get Justin Tadlock to help you with this.

    BNJ

Topic Closed

This topic has been closed to new replies.

About this Topic