Not that at this time, these intructions are valid for V163 only. Thats not to say they won’t work with later versions (I’m sure it will), but finding the exact code to change may be hard. Anyway, read through them all before starting. In some cases, you may want to just comment things out instead of deleting them (read how to do this at the end). And feel free to ask questions.
1. Install http://semiologic.com/software/static-front/ and don’t activate just yet
2. Create a page and give it the slug of home. This will become your static front page.
3. Create a category called blog, and shove all posts into this category or just move all other categories into it. (you don’t have to call it blog FYI)
4. [optioinal] Edit your permalink structure. You cannot remove /category/ from the permalink structure so I changed mine to something generic like /info/ or /OC/ — at least its better than /category/
5. Edit header.php, as you no longer want to have K2 contol the menu options. Make one of the menu links point to the category blog [the link will be something like this: http://www.yoursite.tk.ru.com/OC/blog/ where “blog” is the name of the category you chose to lump everything into. [ED note: this ensures that your visitors will get to your ‘blog’ section, here is what my header.php looks like:
<ul class=”menu”>
<li class=”<?php if (((is_home()) && !(is_paged())) or (is_archive()) or (is_single()) or (is_paged()) or (is_search())) { ?>current_page_item<?php } else { ?>page_item<?php } ?>”><a href=”<?php echo get_settings(’home’); ?>”>Home</a></li>
<li class=”page_item”><a href=”http://www.yoursite.tk.ru.net.com.net/OC/blog/” title=”Blog”>Blog</a></li>
<li class=”page_item”><a href=”http://www.yoursite.tk.ru.net.com.net/about/” title=”About”>About</a></li>
<li class=”page_item”><a href=”http://www.yoursite.tk.ru.net.com.net/pagex/” title=”pagex”>Portfolio</a></li>
<li class=”page_item”><a href=”http://www.yoursite.tk.ru.net.com.net/archives/” title=”Archives”>Archives</a></li>
<?php wp_register(’<li style=”position: absolute; right: 0px;”>’,'</li>’); ?>
</ul>
6. Tweak the loop.php so that it does not truncate listings when viewing a category. Like so
Change this:
<div class=”itemtext”>
<?php if (is_archive() or is_search()) {
the_excerpt();
} else {
the_content(”Continue reading ‘” . the_title('’, ‘’, false) . “‘”);
} ?>
To this:
<div class=”itemtext”>
<?php the_content(”Continue reading ‘” . the_title('’, ‘’, false) . “‘”); ?>
7. Also in the loop, change this:
<?php /* If this is a category archive */ if (is_category()) { ?>
Archive for the ‘<?php echo single_cat_title(); ?>’ Category
To this:
<?php /* If this is a category archive */ if (is_category()) { ?>
This change removes the archives heading when viewing your blog category.
8. The following change just tweaks the text in the sidebar for consistency. Edit sidebar.php and change this:
<?php /* If this is a category archive */ } elseif (is_category()) { ?>
<p><?php printf( __(’You are currently browsing the %1$s weblog iarchives for the \’%2$s\’ category.’), ‘<a href=”‘ . get_settings(’siteurl’) .’”>’ . get_bloginfo(’name’) . ‘</a>’, single_cat_title('’, false) ) ?>–></p>
To this:
<?php /* If this is a category archive */ } elseif (is_category()) { ?>
<p><?php printf( __(’You are currently browsing the %1$s blog listings. </p>
9. Activate the plugin and cross your fingers.
An aside: How to comment things out:
Anything between here <!–
alkjdhfaklsjdfhla djkfhaslkdjfhalskdjfhalskdjfhasldkjfhaslkdjfhasldkjfhaslkdjfhalsdkjfh –>
and here disappears…
Anything between here
and here disappears… Although its still visible in the source code, check it yourself. This is good for testing, but not for final site design.
27 Feb 06
6:29 am
[...] How to: Create a Static Front page with K2 at MaxPower [...]
02 Apr 06
3:33 am
Very informative tutorial. Thank you very much.
19 May 06
2:53 pm
I’m having trouble making this work. All my pages are listed twice in the header nav bar (tabs). Im using K2 V167. Also, I’m getting a parse error in my sidebar. Any ideas?
15 Jun 06
4:37 pm
Wonderful!
It was the that I was missing - thanks.
16 Jun 06
12:34 pm
Hiya, I’m getting a parse error when putting the !div class=”itemtext”>
16 Jun 06
1:39 pm
Make sure you have the proper quotes. If you just copy and paste the above code it (unfortuneatly) often screws up. So just retype the quotes. I’ll assume you meant to use the exclamation mark. A parse error comes from the PHP, so your error is probably unrelated to the itemtext CSS div. Send me the code to look at if you like.
22 Jun 06
2:49 pm
This is unrelated, but I wonder if anyone knows how to edit the “Continue reading…” bit to just “read on” (with no title of the post mentioned).
I find it pretty redundant to repeat the title again.
thanks in advance,
JK
22 Jun 06
11:30 pm
JayKidd,
Your first stop for Wordpress questions should always be the codex. Here is a good rundown on modifying the ‘more text’. K2 works slightly different than most themes in that the more text is specified in theloop.php. Do a search for ‘the_content(__(’Continue reading’,'k2_domain’)’ and change Continue reading to whatever it is you want. Good luck!
23 Jun 06
1:43 am
thanks deepthought,
i actually did that last night but nothing happened. But after reading your post, i decided to do it again just to make sure.
and it worked!
Here’s what I did. I wanted to change “continue reading blah, blah title” to just “read on”
the_content(__(’Continue reading’,'k2_domain’) . ” ‘” . the_title(”, ”, false) . “‘”);} ?>
to
the_content(__(’read on’));
hope that helps other people scractching their heads.
cheers,
JK
28 Jun 06
3:59 pm
I followed your instructions and everything works fine apart from that I can’t get the background of the menu items to behave according to what is sayin on the css. The only one with works is the home . When I click on the blog item I also get only the home highlighted. I realised that I’m not getting the extra class current_page_item on the page code when I click on the list items on the menu.
Any ideas? Thanks
29 Jun 06
9:00 am
Ivan, do you have a website I can visit? Feel free to contact me using the contact form if you like.
28 Jul 06
7:22 pm
[...] How to: Create a Static Front page with K2 at MaxPower (tags: wordpress k2) [...]
08 Aug 06
2:10 am
Can someone post an example of this?
13 Sep 06
11:56 am
I think theloop.php file has been changed by the K2 developers since this post was originally published. There are a few lines in the new loop that aren’t listed anymore in this how-to. Anyone out there know how to get semiologic’s plug-in to work properly with the newest beta of K2?
13 Sep 06
1:28 pm
By the way, the next version of Wordpress is supposed to have some kind of static home page option ie make a page your home page.
26 Sep 09
9:56 am
Wonderful!
It was the that I was missing - thanks.