Trying to figure out K2
Still thinking about what do do with the design of my main blog. Keep K2? Find another theme? Leave things as they are?
I’m inclined to stick with K2, notwithstanding my frustration in trying to get some help to figure out how to do certain things. If I do stick with it, I want to install the latest version 0.9.1.
I’m now trying to figure out what to edit in theloop.php so that each post includes the time as well as the date.
I’m no expert at PHP editing, and it looks as though some major changes in the PHP code have been implemented in the development of K2 0.9.1 compared to K2 r167b which is the version still running on the main blog.
For instance, with 0.9.1, the code to display the text “Published by neville December 24th, 2006 in WordPress and Themes” that you see in the previous post is this:
<?php /* Date & Author */ printf( __('Published %1$s %2$s','k2_domain'), ( $multiple_users ? sprintf(__('by %s','k2_domain'), '<span class="vcard author"><a href="' . get_author_link(0, $authordata->ID, $authordata->user_nicename) .'" class="url fn">' . get_the_author() . '</a></span>') : ('') ), '<abbr class="published" title="'. get_the_time('Y-m-d\TH:i:sO') . '">' . ( function_exists('time_since') ? sprintf(__('%s ago','k2_domain'), time_since(abs(strtotime($post->post_date_gmt
. " GMT")), time())) : get_the_time(__('F jS, Y','k2_domain')) ) . '</abbr>' ); ?>
At least, I think it’s in there somewhere.
I can see that the code for displaying the time is there. What that does is show the time if you hover your mouse over the date. Sort of cool, I suppose, but I don’t want that.
What I do want is to actually display the time in a post, just as it currently does with r167b on my main blog.
But I cannot see where to make that happen.
Not only that, the syntax looks entirely different in 0.9.1’s theloop.php compares to r167b’s.
Here’s the code in the r167b theloop.php that takes care of displaying the date (and, with my customization, the time) in a published post:
Posted <?php /* If there is more than one author, show author's name */ $count_users = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->usermeta WHERE `meta_key` = '" . $table_prefix . "user_level' AND `meta_value` > 1"); if ($count_users > 1) { ?> by <?php the_author_posts_link(); } ?> on <?php the_time('F j, Y'); ?> at <?php the_time('G:i'); ?> UK time
Doesn’t seem to bear any relation to the code in the 0.9.1 theloop.php, does it?
This is a pretty fundamental thing for me and it’s a big headache just trying to figure it out on my own.
I’ll persevere a little, but if this is indicative of what the new K2 version will be like, then this theme’s not for me.
Comments
Leave a Reply