How To Make Blix Theme Ready for WordPress 2.1

Just a heads up to those out their in blogland who, like me, use Blix by Sebastian Schmieg as their WordPress theme.

The upcoming version 2.1 has made some change which mess up Blix’s handling of its navigation bar. The fix is simple and I post it here to allay anyone’s nerves who begin to panic when their pages seem to disappear.

In the Blix theme folder there’s a file called BX_functions.php and somwhere about halfway through is a function BX_get_pages…

function BX_get_pages($with_content = '')
{
   global $wpdb;
   $query = "SELECT ID, post_title, post_name FROM " . $wpdb->posts . " WHERE post_status='static' ORDER BY menu_order ASC";
   if ($with_content == "with_content") {
      $query = "SELECT ID, post_title,post_name, post_content FROM " . $wpdb->posts . " WHERE post_status='static' ORDER BY menu_order ASC";
   }
   return $wpdb->get_results($query);
}

When you eventually upgrade to WordPress 2.1 you will need to make two small changes to this function. Find the text WHERE post_status='static', which occurs twice, and change it to WHERE post_type='page'. That’s all there is to it.

66 replies on “How To Make Blix Theme Ready for WordPress 2.1”

  1. Instead of duplicating so much codes…I used this

    function BX_get_pages($with_content = ”)
    {
    global $wpdb;
    $query = “SELECT ID, post_title, post_name FROM ” . $wpdb->posts . ” WHERE post_type=’page’ OR post_status=’static’ ORDER BY menu_order ASC”;

    if ($with_content == “with_content”) {
    $query = “SELECT ID, post_title,post_name, post_content FROM ” . $wpdb->posts . ” WHERE post_type=’page’ OR post_status=’static’ ORDER BY menu_order ASC”;
    }
    return $wpdb->get_results($query);
    }

    Now it works!

  2. Glad it’s helping… I found another blip in Blix last night which you might want to also fix. The BX_archive function (in BX_function.php) needs its two queries modified so that it doesn’t include pages in the archive listing. An extra "AND post_type='post'" in both places does the trick.

  3. Thanks! you saved my day!

    got a small problem though… my pages- links, about and archives appear in the recent posts as well as archives main page…

    how can i remove them?

  4. yuvach: Same principle… the BX_get_recent_posts fucntion has a query … change

    … WHERE post_status=’publish’ …

    to

    … WHERE post_status=’publish’ AND post_type=’post’ …

    I don’t use this part of Blix so I hadn’t thought to check it.

    Good luck!

  5. Darius: I agree that I’d prefer to use WordPress’s own functions which are “less” likely to stop working if internals are changed … however the solution presented at your link to WP support seems at first glance to miss out the translation of the about page title etc.

    The Blix solution isn’t very elegant but it would take rather more surgery to replace it.

  6. jase, affy, et al.: it’s a pleasure … I like the look of Blix and really didn’t want to abandon the investment I’d made in adapting it to my needs.

  7. The fix doesn’t seem to work with the current version of wordpress…

    However, modifying the query like this works:

    WHERE post_status=’static’ OR post_status=’page’ ORDER BY menu_order ASC

  8. Sean: Just looking at the site doesn’t really help. Maybe you could send me a copy of your BX_get_pages fucntion in BX_functions.php and I could have a look?

  9. Hi People,

    I released a blix based theme about 2 months ago called BlixKrieg – it drops right over an existing Blix Theme, and is also WordPress 2.1 (and backwards) compatible – It also enables you to include google adsense ads if you want them (and allows you to easily configure what type of ads you display, and if you want to display them, from one simple to use config file) – if you’d like to download it, it is free – Download BlixKrieg From UtheGuru.com

  10. The BlixKrieg theme is, how hould we say it, well proven, but the 2.1 compat changes are still one step after beta – whatever that is 🙂 Just feel free to post on my blog if you have any probs – I’m pretty into blix, so it’s likely I’ll get you an answer and an update to any of your probs pretty quickly… Any and all code suggestions are appreciated.

    Also, anyone that wants to help me rewrite the ReadMe (from a newbie perspective) will be welcomed with open arms 🙂

    Thanks!

    TheDuck

  11. Hey great fix for some of this issues related to the Blix Theme. I hope you might be able to help me out!

    It maybe something silly but where my blogroll list would be I’ve re-named it Friend’s Sites instead. However for some unknown reason it has created the Friend’s Sites link under Categories, which I didn’t want any clue how to get rid of this under Categories?

    Cheers!

  12. Donna: I’m not sure … but is this anything to do with WP2.1 merging the links and categories into one table? Link categories are displayed as well as post categories when you list them all. I’ve used hide_empty=1 in the wp_list_cats call to only show categories which have posts. I suspect that is a hack and 2.1 has some new template tags for handling, e.g. wp_list_categories.

  13. Hi Guys, noticed another similar problem to the previous post I added. Although it solved hiding Friend’s Sites from under categories on the front page.

    Whenever you go into a post to read it I notice it appears in the Posts by Category section. Any ideas how to hide it away in this section also?

    Cheers

  14. This post saved mye life, as I’m tweaking the theme ‘orangescale laila butterfly-1.0’ which has the same problem with WordPress 2.1 as Blix.
    Thanks for posting this info – and God save the blogs 🙂

  15. sorry for the dumb question but I’m glad I found this page and the help for the Blix theme and wondered if you could help a newbie out… how do you uncomment php???

    thanks,

    Mark

  16. Mark: PHP has several ways to put comments into code. A single line can be made into a comment by putting // at the start of the line. Longer comments can be marked out by sandwiching them between /* and */.

    Ordinarily comments are meant to do just that, comment on the code, but sometimes you want to take a piece of php code and stop it being processed. You could delete it but you might want to put it back at some future date. What you can do is turn the code into a comment. That way the php interpreter ignores it.

    To uncomment some php code all you have to do is remove the characters that mark it as a comment — delete the // or the /* and */

    That sounds convoluted but its easier to do than it is to describe. Good luck.

  17. Rob, thanks a lot for the info – I knew the premise of commenting code but your post really helps me a lot. Your blog seems to have a lot of things going on in the sidebar that I can’ seem to activate, such as recommended readings and most recent posts. Are these commented out of the Blix theme and if so do you know which pages, or where on the sidebar page I should be looking. Or, are these add-ons that either you created or are they plugins?

    thanks again, Mark

  18. ok last post I promise. what code is necessary to turn on the green CSS title bar for most recent comments? It shows up on the category and permalink pages but not the front page?

    many thanks, mark

  19. Mark: Hi! Thanks for the flurry of comments. It’s nice that answer your own questions too 😉

    I followed the example that was already there in the Blix sidebar.php and marked up like this:

    <h2><em>Most Recent Comments</em></h2>

    That’s all inside a <div id="subcontent"> though.

    Does that help?

  20. I’ve just inherited maintenance of a wordpress site; I’ve used other CMSs but am a WP newbie.

    The Blix theme seems to only support 7 tabs – is that true? The 8th tab is essentiallly invisible, becoming what acts like a drop-down to the first tab.

    Is there an easy way to fix this, or is it more a matter of my getting a clue somewhere 😕

Comments are closed.