WordPress.org

Forums

Phpcalendar and wordpress, date on posts don't show (6 posts)

  1. ludvig87
    Member
    Posted 9 years ago #

    I have had this problem for quite a few years.

    The problem appears when I include the calendar from phpcalendar (codegrrl.com) onto a page where there are posts from wordpress appearing.

    If the calendar appears before the posts, the date doesn't appear, but if they appear after the posts the date of the posts will show.

    An example is here: http://www.jondt.dk

    My coding for the time and date is:
    F, jS y

    Anyone who have a clue what I can do?

  2. Cyndy Otty
    Member
    Posted 9 years ago #

    Hmm, well looking at the code I don't see anything that would conflict with WP. (And if it did, it wouldn't matter where you include it...I would think.)

    I tried installing it and I can't seem to recreate your problem.

  3. ludvig87
    Member
    Posted 9 years ago #

    I tried to create 2 files, one where the include to the calendar comes first, and one where the calendar comes as the last thing.

    Here it is as Last:
    http://www.jondt.dk/calendarlast.php

    Here it is as First:
    http://www.jondt.dk/calendarfirst.php

    As you can see, the date works when the calendar is included after the include to wordpress.

    The coding look like this for the files

    <?php include("calendar/calendar.php") ?>
    <?php /* Don't remove this line. */ require('wordpress/wp-blog-header.php'); ?>

    <?php wp_get_archives('type=monthly&format=link'); ?>
    <?php //comments_popup_script(); // off by default ?>
    <?php wp_head(); ?> <img src="../img/layout/heart.gif" alt="" /> <b>Recent news</b><?php c2c_get_recent_posts(); ?>
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <?php static $counter = 1; if ( $counter > "20" ) { break; } else { if ( in_category(2) && !$single ) { ?>
    <img src="../img/layout/heart.gif" alt="" /> <b> <?php the_time(); ?></b>
    <img src="../img/layout/arrow.gif" alt="" /><i> <?php the_title(); ?> </i>
    <?php the_content(); ?>
    <?php $counter++; } } ?> <?php endforeach; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>

    <?php endif; ?>

    But on this page: http://www.deep-within.dk

    Where the include to the calendar comes first, the date works.

    What is the difference?

    is there anything in my wp codes that can be the difference?

  4. Cyndy Otty
    Member
    Posted 9 years ago #

    Are you running the same version of WordPress in both places? You're missing so much of the normal WP header on the page of your site I can't tell what you're running.

  5. ludvig87
    Member
    Posted 9 years ago #

    1.5.2 (deep-within)
    1.5 (jondt)
    -
    This problem has existed for about 1-1½ year, even though I had the same wordpress installed.

  6. jaseone
    Member
    Posted 9 years ago #

    Well for a start you should read:

    http://codex.wordpress.org/Stepping_Into_Templates

    You seem to be trying to do things in a round about way, your actual "problem" is that the WP include includes HTML header information and if you call the calendar first it screws your output up even more, even the "working" example doesn't really work as it is totally invalid HTML.

Topic Closed

This topic has been closed to new replies.

About this Topic