Messing Around with my wordpress theme

Posted 18th January 2008 | View Comments

Well I finally managed to find a wordpress theme that I like , problem with the default one is that there's only a small amount of viewable area and lots and lots of blue background areas. The new theme talian-10 is a three column theme and spreads throughout the span of the browser, also it gave me a chance to show more of my widgets. Sure you can add widgets to a theme with one sidebar column but the chances are users wont see them often. Since this is a blog most users just view the home page and move on , very few actually scroll down to see the rest of the posts , so very few actually see the widgets that are placed in the bottom of the sidebar. With this new theme viewers can see three widgets and the RSS subscriber as well , so now I can show recent entries and the recent comments to the user without him having to scroll down. ( you can see them right ? :) )

After installing the theme I started to play around with the code. The theme is written using PHP and modifying it is not that hard. I'm relatively new to PHP so it was a bit hard at first but you get used to it after playing around with it for a while. Well I didn't learn much PHP but I did learn some MySql :) . Well if you haven't heard about is Sun bought MySql for $1B.

Well here's how I learned my MySql , I wanted to limit the number of recent comments and recent posts shown to 5. So I searched through the code and found an interesting thing. In MySql you can limit the number of rows returned by using the keywork LIMIT :) . Why cant the Oracle gurus think of implementing such a basic functionality is beyond me. So the following SQL query will retrieve only the first 10 records.

SELECT person_name FROM Person_Table LIMIT 10 -- simple and cool

and if you want to say get rows between 5,10 that can also be done easily.

SELECT person_name FROM Person_Table LIMIT 5,5

I'm almost certain Oracle doesn't have this functionality , but feel free to correct me if I'm wrong. Thats enough of MySql from me. Feel free to comment about the theme and if any of the widgets doesn't work in your browser.

Post Title: Messing Around with my wordpress theme
Author: Nishadha
Posted: 18th January 2008
Filed As: Blogging Tips
Tags: , ,
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

View Comments been expressed on “Messing Around with my wordpress theme”. What is your opinion?
  1. Ajith commented:

    I think you can use the BETWEEN to fetch values in a range in Oracle and I think your right about the LIMIT thing , I dont think Oracle have that functionality.

  2. AbraCadabRa commented:

    If i’m not mistaken, the wordpress function that you call to return the recent posts etc.. also accepts a variable that you can use to tell the function how many results you want back. Without messing with the Mysql queries :)

  3. Rakhitha Karunarathne commented:

    Oracle does not have a LIMIT keyword. But they have a similar feature which can be used to implement same result as LIMIT in an over complicated way.

    Its a implicit column called ROWNUM which is available with every query and the column contains the number of the row.

    Ex:-
    my sql query
    SELECT person_name FROM Person_Table LIMIT 10

    can be translated to oracle query
    SELECT person_name FROM Person_Table WHERE ROWNUM < 10

    here is a an article about it
    http://www.adp-gmbh.ch/ora/sql/rownum.html

  4. rumbling commented:

    Thanks AbraCadabRa for pointing that out , instead of modifying MySql you can easily do that by modifying the get_archives and mw_recent_comments functions found in sidebar.php , these are specific to this theme so you want find in other themes.

  5. Rakhitha Karunarathne commented:

    Oracle does not have a LIMIT keyword. But they have a similar feature which can be used to implement same result as LIMIT in an over complicated way.

    Its a implicit column called ROWNUM which is available with every query and the column contains the number of the row.

    Ex:-
    my sql query
    SELECT person_name FROM Person_Table LIMIT 10

    can be translated to oracle query
    SELECT person_name FROM Person_Table WHERE ROWNUM < 10

    here is a an article about it
    http://www.adp-gmbh.ch/ora/sql/rownum.html

Leave a Reply

blog comments powered by Disqus