For some reason the publish time is always the same for all my homepage posts and it shows just the present time. I use a custom index file but I’ve checked it and it’s identical to what I use on another site which doesn’t have the problem.
Are you sure you’re using the proper function to call the time the post was published?
Also make sure that you are using the function within your Loop (before you use
<?php endif; ?>
Thanks for the reply.
This is the function I’m currently using.
<?php the_time(‘F jS, Y, g:ia’) ?>
I’ve checked and it’s within the loop.
I tried just the basic <?php the_time(); ?> and it didn’t alter anything.
Have you tried disabling your plugins or switching your theme temporarily? There may be some code somewhere that’s throwing this off. Would you mind pasting your Loop code to pastebin so we can take a look?
Sure. Thanks so much for taking the time BTW. I’ll go try what you just suggested.
get_header(); ?> <?php dynamic_content_gallery(); ?> <div id="content" class="narrowcolumn" role="main"> <?php if (have_posts()) : ?> <?php $posts=query_posts($query_string . 'posts_per_page=10&offset=2'); while (have_posts()) : the_post(); ?> <div class="postcontainer"> <div class="icon"> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <?php custom_field_image() ?> </div> </div> <div class="recentpost"> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <h2><a>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <span class="entry-meta"><?php the_time(); ?> <!-- by <?php the_author() ?> --></span> <small2><?php the_content_limit(200, "lisez plus") ?></small2> <span class="entry-meta"><span class="edit-link"><?php edit_post_link('Edit', '', ' '); ?></span></span> </div> </div> </div> <div class="hr"><hr /></div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('« Older Entries') ?></div> <div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div> </div> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php get_search_form(); ?> <?php endif; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
[Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your posted code may now have been permanently damaged/corrupted by the forum’s parser.]
In the future, use a site like http://pastebin.com/ to paste this code so it is readable.
I’ve noticed that all your posts link to an external URL, are you using a plugin for this or a function? You have to make sure that you set the date on your post in the admin panel correctly as well.
Yes I’m using a plugin called “Page Links To” to direct posts to my forum. I’ll deactivate plugins one by one to see if I can’t diagnose the problem. Post time is usually set automatically in the admincp no?
Yea it is automatically set, but it’s worth going back through the posts to make sure that they are set to a date that is not today’s.
hmm ok I checked the admincp and the post times are correct there. It must be a plugin that is interfering. I’ll check it out tongiht.
Found the problem. It was the qTranslate plugin. I’ll have to ascertain why and see if there is a fix but at least I know which plugin in the culprit.
On the “Translations” options, in the admin page of the plugin, in “Advanced Settings”, there are 4 options shown as selection boxes. Select the last one, that states “Use strftime (…) and replace formats (…)”. That should solve the qTranslate display issue.
Except I had to select “Use emulated date function.” Fixed.
- The topic ‘All posts show same publish time’ is closed to new replies.