Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Search Search
Search for:
Tech Support Guy > > >

Change language on blog archive - Lightword Wordpress Theme


(!)

lilith2046's Avatar
lilith2046 lilith2046 is offline
Computer Specs
Member with 20 posts.
THREAD STARTER
 
Join Date: Apr 2012
Experience: Beginner
17-Aug-2012, 05:42 AM #1
Change language on blog archive - Lightword Wordpress Theme
Hi!
I just started a blog using wordpress, and I downloaded the Lightword theme. The problem is, I can't figure out how to change the language on the blog archive. I'm writing my blog in Swedish so I want to change the blog archive from displaying "Select Month" and "January, February" etc to Swedish. I don't know where to find the code and change it...

Here is the code I found, but I don't know what to with it. Anyone have any ideas?

(Here's the blog btw: http://www.smultronsnaret.se

<?php
/*
Template Name: Blog archive
*/
?>
<?php get_header(); ?>
<div id="content-body">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2><a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php the_content(__('Continue reading','lightword'));?>
<?php
// echo archives start
$lastpost = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_date <'" . current_time('mysql') . "' AND post_status='publish' AND post_type='post' AND post_password='' ORDER BY post_date DESC LIMIT 1");
if(empty($output)){
$output = '';
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'hfy_archives_%'");
// Get all of the months that have posts
$monthquery = "SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, count(ID) as posts FROM " . $wpdb->posts . " WHERE post_date <'" . current_time('mysql') . "' AND post_status='publish' AND post_type='post' AND post_password='' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC";
$monthresults = $wpdb->get_results($monthquery);

if ($monthresults) {
// Loop through each month
foreach ($monthresults as $monthresult) {
$thismonth = zeroise($monthresult->month, 2);
$thisyear = $monthresult->year;

// Get all of the posts for the current month
$postquery = "SELECT ID, post_date, post_title, comment_count FROM " . $wpdb->posts . " WHERE post_date LIKE '$thisyear-$thismonth-%' AND post_date AND post_status='publish' AND post_type='post' AND post_password='' ORDER BY post_date DESC";
$postresults = $wpdb->get_results($postquery);

if ($postresults) {
// The month year title things
$text = sprintf('%s %d', $month[zeroise($monthresult->month,2)], $monthresult->year);
$text_id = strtolower(str_replace(" ","",$text));
$postcount = count($postresults);
if($postcount=="1") $postcount_text = "post"; else $postcount_text = "posts";
$output .= "<h2 class=\"archive_h2\"><a onclick=\"jQuery('#$text_id').toggle();\">" . $text . "<span> (" . count($postresults) . " ".$postcount_text." )</span></a></h2>";
$output .= "<ul id='$text_id' class='hide'>\n";

foreach ($postresults as $postresult) {
if ($postresult->post_date != '0000-00-00 00:00:00') {
$url = get_permalink($postresult->ID);
$arc_title = $postresult->post_title;
if ($arc_title)
$text = wptexturize(strip_tags($arc_title));
else
$text = $postresult->ID;
$title_text = esc_html($text, 1);
$output .= ' <li>' . mysql2date('m/d', $postresult->post_date) . ':&nbsp;' . "<a href='$url' title='$title_text'>$text</a>";
$output .= '&nbsp;(' . $postresult->comment_count . ' ';
if($postresult->comment_count=="1") $output.= "comment"; else $output.= "comments";
$output .= ")</li>\n";
}
}
$output .= "</ul>\n\n";
}
}
update_option('hfy_archives_'.$lastpost,$output);
}else{
$output = '<strong>'. __('I am Error!','lightword') .'</strong> '. __("Det finns tyvärr ingenting här.","lightword") .'';
}

}
echo $output;
//echo archives end
?>

<?php endwhile; else: ?>

<h2><?php _e('I am Error!','lightword'); ?></h2>
<p><?php _e("Det finns tyvärr ingenting här.","lightword"); ?></p>

<?php endif; ?>

</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
JiminSA's Avatar
JiminSA   (Jim) JiminSA is offline JiminSA has a Profile Picture
Computer Specs
Member with 1,680 posts.
 
Join Date: Dec 2011
Location: Johannesburg South Africa
Experience: Intermediate
17-Aug-2012, 08:58 AM #2
Hi Lilleth!
Don't know much about WordPress, but I see that they cater for all languages (or claim to in this link)
I imagine that you are developing a lightword template in WP - if so the link should cover it...
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑