WordPress.org

Ready to get started?Download WordPress

Forums

Troubles with calendar (14 posts)

  1. nirm
    Member
    Posted 8 years ago #

    My blog is going to be a part of my homepage.
    I want to have the calendar on the first page of my site,
    so when you click on a date, you are sent to the post. .

    I've tried using iframes, and tried to make a file that shows only the calendar I can link to in the iframe page. But I only get error:

    Fatal error: Call to undefined function: get_calendar()
    (then the adress to the file, and the line the error is in).

    And it's not supposed to open in the iframe, but the mainpage.
    I've seen it work, I just don't know how..

    I'm hoping someone has some ideas of what I can do.

    Thanks.

  2. moshu
    Member
    Posted 8 years ago #

    Don't use iframe, it's that simple.
    I have a calendar on a subdomain:
    http://crosscultural.transycan.net/
    and it will take you to a blog that's in a different subfolder of the site. Just click on Dec.

  3. nirm
    Member
    Posted 8 years ago #

    Thanks.

    I'm still stuck.

    How do I get the calendar on my page, so that it will automatic updated?
    I've tried with different kodes, but nothing works for me.

  4. moshu
    Member
    Posted 8 years ago #

    Your page has to be a .php file.
    Put on the top of it, before everything else, this:
    <?php
    require('./path-to-your-blog/wp-blog-header.php');
    ?>

    and then you can use any WP function in that file. E.g. I just put in the sidebar this:
    <?php get_calendar(); ?>
    That's it.

  5. nirm
    Member
    Posted 8 years ago #

    Thanks again.
    I still don't get it to work. Even a small php file wont show the calendar. I don't know what I do wrong.

    I only get the message;

    Fatal error: Call to undefined function: get_calendar() etc.

  6. vkaryl
    Member
    Posted 8 years ago #

    Your index page MUST be index.php to do this sort of thing.... a separate php file won't get it.

  7. moshu
    Member
    Posted 8 years ago #

    Hmmm... I just tested with a file (saved the index.php as whatever.php, uploaded) and it works.

  8. vkaryl
    Member
    Posted 8 years ago #

    Oh, that, yes. I understood him to mean (for some reason) that he was putting that in a "small php file" and then trying to load that file probably through the normal html....

  9. nirm
    Member
    Posted 8 years ago #

    Thanks for the help :-)

    Perhaps I'll find out what I'm doing wrong.

    Is there any files I need to download extra for it to work? I've only installed what I dowloaded.

  10. nirm
    Member
    Posted 8 years ago #

    I wrote the code that moshu wrote in a notepad. Saved as a php file, uploaded it to my hoast, and tried to view it in a browser... Then I get the error message.
    I tried both with and without html tags.
    Something I did wrong there perhaps?

  11. moshu
    Member
    Posted 8 years ago #

    Did you replace the "path-to-your-blog" part with the real path where your WP install is?

  12. nirm
    Member
    Posted 8 years ago #

    Yes. I chanched to my domain name, and folder where wp is installed.

  13. moshu
    Member
    Posted 8 years ago #

    No. Path is not URL.
    The path is from your page (where you want the calendar!) to the WP install.
    E.g. if my main page is in the root and my WP install is in a folder called "moshu" - then the path is:
    <?php
    require('./moshu/wp-blog-header.php');
    ?>

    Edit. Next time give us a real link and we can save a lot of time an space :)

  14. nirm
    Member
    Posted 8 years ago #

    I got it right :-D

    Thanks. Sorry about the missing link.

    Thank you so much for the help. Really nice of you.

Topic Closed

This topic has been closed to new replies.

About this Topic