• 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: https://www.jondt.dk

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

    Anyone who have a clue what I can do?

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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.

    Thread Starter ludvig87

    (@ludvig87)

    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:
    https://www.jondt.dk/calendarlast.php

    Here it is as First:
    https://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: https://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?

    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.

    Thread Starter ludvig87

    (@ludvig87)

    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.

    Well for a start you should read:

    https://codex.www.ads-software.com/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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Phpcalendar and wordpress, date on posts don’t show’ is closed to new replies.