Giraffe Theme

download

Download: giraffe.zip
Supports: WordPress 1.5

This is a fluid-width theme that attempts to split the front page of a blog into three sections:

  • Lead posts. The latest posts, with full-width and a large font
  • Recent posts. Slightly older, with shorter width, smaller font
  • Older posts. Everything else, displaying just the titles

blueredgreen

Localization

The theme is fully localized. This means it can be translated into other languages without having to modify and hack the theme to bits. The list of available translations is:

To install a translation, download the .MO file and upload it to the theme directory. You should ensure that the setting of the WPLANG value in the wp-config.php file matches the translation.

The theme contains a .PO so anyone can translate the words using a tool such as poEdit. I would greatly appreciate if any translations could be sent to me so that I can include them here for everyone else.

Support Plugin

adminThe theme has a support plugin that provides an administration interface and the capability to configure the theme:

  • Change colour scheme
  • Change font and font size
  • Change whether to have a full-width lead post, or more traditional two-column layout
  • Change page dimensions
  • Configure number of lead posts, recent posts, random posts, and latest comments
  • Switch logo on or off
  • Compress CSS by reducing unnecessary comments, spaces, and returns. Shrinks the file by about 2K – not a lot, but every little helps.

This plugin is optional and the theme will work without it, although obviously you miss out on any configuration. Note that if you want Gravatars displayed then you will need to install the separate Gravatar plugin.

Installation

Installation of the theme is just like any other theme:

  1. Download
  2. Unzip
  3. Upload the ‘giraffe’ directory to your /wp-content/themes/ directory
  4. Enable the theme from the administration screen

You must make the theme directory and the files style.css, index.php, single.php, and page.php writeable. If you do not, you will receive an error in the admin interface when updating any details.

Installation of the plugin is also just like any other plugin:

  1. Download
  2. Unzip
  3. Upload the ‘giraffe’ directory to your /wp-content/plugins/ directory
  4. Enable the plguin from the administration screen

Please delete any pre-1.3 Giraffe plugin.

You can change the logo by either disabling it from the administration plugin, or by uploading a new image called ‘logo.png’ or ‘logo.gif’ to the theme directory. The theme will serve a PNG to all non-IE browsers, and a GIF to IE. You can use fancy alpha-blending with the PNG, yet still keep a decent image for IE users.

Modifying the top navigation menu

By default the Giraffe theme will display a list of WordPress pages in the top navigation menu (the bar just below the logo). This means that to modify entries in this menu all you need to do is to change your WordPress pages.

If you want to customize the list further, or you want to create your own list, then you can do so by editing giraffe_functions.php in the theme directory and adding a function:

function giraffe_top_menu () {
... your code
}

The function should output the menu as a series of HTML list elements <li>…</li>. For example, if you want to directly enter the menu:

function giraffe_top_menu () { ?>
<li><a href="something.com">First choice</a></li>
<li><a href="anotherthing.com">Second choice</a></li>
<?php
}

Other details

To get Gravatars working you will need to download and install the WordPress Gravatar plugin.

The number of ‘older posts’ is determined by the WordPress configuration option ‘Options/Reading/Blog/Show at most’ and the Giraffe options ‘Number of lead posts’ and ‘Number of recent posts’. If you have WordPress configured to display 10 posts, and the Giraffe theme configured to display 1 lead and 3 recent posts, then the number of older posts will be 6.

145 Responses to Giraffe Theme

  1. Thanks for the review Angsuman. Some good suggestions there, and I’ve included them in a new version.

    I’ve had to keep the plugin as it’s necessary for the admin interface, but now it’s optional and only contains the code for the interface itself (the rest is in the theme).

    (incidently, I tried posting this on your website but just get a blank screen when I submit)

  2. Nice theme.

    There are (in v1.9) however still two hardcoded references to the wp_posts table in giraffe.php, which need to be changed to $wpdb->posts.

    This is in function giraffe_random_posts.

    Colin

  3. Best theme.

    There is (in v1.10) a small problem in the function giraffe_latest_comments: the comments classifies as Spam are visible.

    P.S. there are few simple problem of validation W3 (tag alt ecc ecc)

    Excuse for my English.
    raDIO

  4. You are correct raDIO, I didn’t check the spam field. The theme has been updated to ignore spam, and some validation warnings corrected.

  5. My error:

    Fatal error: Call to undefined function: mysql_real_escape_string() in /wp-content/plugins/giraffe/giraffe.php on line 185

    Point me in the right direction?

  6. Fatal error: Call to undefined function: giraffe_have_lead() in /mnt/web_f/d36/s13/b024fd4b/www/wordpress/wp-content/themes/giraffe/index.php on line 7

    Just installed v1.12.

  7. I figured out the undefined function: giraffe_have_lead(), deleting and re-installing the plugin fixed it. I did try this the first time, but something must not have gone right, or there is a particular order required for a proper upgrade. Anyway all is well again, still lov’in the theme. Now if only I can gets some decent content going so I can get some commenting.

  8. John, I am a newbie. I installed your themes, very nice and when I try to update options it give me this message : “Problem updating files – is the theme directory write-enabled?”. Everything run on Mac os X, I check the permissions of the themes directory and it is read and write for user and group …. What is it that I am not seeing?

  9. There must still be some permissions problem. When you press ‘Update options’ it tries to overwrite the current style.css and index.php – both of these must have write permissions too.

  10. The theme is perfect I have been looking for GUI theme editor for a while, Thank!! Question, how would I add the sidebar “pages” above Archives, I feel that is key to my website. Please be detailed I am very bad at editing PhP.

  11. Edit /wp-content/themes/giraffe/sidebar.php and add the following line before the Archives:

    <?php wp_list_pages('title_li=<h2>Pages</h2>&depth=1');?>

    So you should have something looking like:

    <?php wp_list_pages('title_li=<h2>Pages</h2>&depth=1');?>
    <li><h2><?php _ge('Archives')?></h2>
    <ul>
    <?php wp_get_archives('type=monthly'); ?>
    </ul>
    </li>

  12. trying to install the plugin because I’d love to be able to configure this theme, and for the life of me, I CAN NOT get the plugin running properly.

    I keep getting this error:

    Fatal error: Call to undefined function: load_theme_textdomain() in /home/.salazar/kcausin/indiekids.org/wp-content/plugins/giraffe/giraffe.php on line 11

  13. Hi Keith, what version of WordPress are you using? I haven’t checked, but I believe the theme will only work on version 1.5+. Look in the /wp-includes directory for the file ‘wp-l10n.php’ – this WordPress file should contain the function that is causing an error.

  14. I have just installed the giraffe theme for my daughter, but I seem to not to be able to get past these two issues.
    Started looking at code but was unable to figure out the issue.
    ERRORS are:
    Warning: main(giraffe.php): failed to open stream: No such file or directory in /home/.sites/28/site188/.users/100/cristina/web/wp-content/themes/giraffe/header.php on line 1

    Warning: main(): Failed opening ‘giraffe.php’ for inclusion (include_path=”) in /home/.sites/28/site188/.users/100/cristina/web/wp-content/themes/giraffe/header.php on line 1

    Things I have checked.
    – another user can read file
    – permissions
    – downloaded the theme again
    I am not sure if you have a quick fix or can point me in the right direction.
    Daughter would love to have the theme.
    Thanks in advance.
    Michael

  15. If I try and access the giraffe.php file directly on your website I get the same error message that Keith reported a few days ago here. What version of WordPress are you using?

  16. John I have the newest version of WordPress version 1.5.2.
    Otherwise I am lost on where to go from here.
    I disabled the plugin as well which did not improve or change the error.
    Michael

  17. Thanks John for the info.
    I have removed the older version of the giraffe theme and plugin and installed the newer version.
    The results funny enough were exactly the same meaning the error stayed consistant.
    I was tried to find an older version of your theme on the web just to verify if the theme is the issue or WordPress.
    I mean you never know it could be someone elses issue and not yours.
    Michael

  18. Hi John,

    The only question I have is about getting the trackbacks to show like you have here. It seems that the download version doesn’t have that feature. Am I missing something?

  19. I tried running the plugin in my blog and it gave me an error about function _g() being undefined. I’m running a stock WP 1.5.2, no mods, just some themes I’ve uploaded. After jiggling some stuff around I’m able to activate the plugin w/o errors, but I don’t see any effect so I think it’s not really active. Where is the admin UI for the theme supposed to be?

  20. Michael, sorry to take so long to respond. I’m stumped as to why you are receiving the error. I took a fresh copy of the latest WordPress, installed it on my computer along with the Giraffe theme, and everything worked fine. It’s possible that your host has some strange configuration problem. Could you type this into a file:

    <?php phpinfo () ?>

    Put it on your website, and send me the link. It will tell me what PHP configuration you have so I can try and see where the error is.

    Also, try disabling all plugins and see if that has any effect.

  21. Fatal error: Call to undefined function: get_the_category_list() in /home/dctheatr/public_html/reviews/wp-content/themes/giraffe/index.php on line 7

    Any ideas?

  22. John thanks for not forgetting us.
    Since I last posted the theme has been downloaded again and uploaded again. As you can see by the original link the results are the same.
    All plugin’s have been disabled which did not help.
    I have included the php info link which might be helpful.
    Thanks again for the help.
    Michael

  23. Gettingthere…

    Get this when trying to update from options plugin
    Problem updating files – is the theme directory write-enabled? (It is)

    Get this on all posts
    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
    SELECT category_nicename FROM wp_categories WHERE cat_ID=

  24. Well I have figured a little out :-)
    Thanks John for the patience

    I started another fresh WP install

    When I activate permalink I get the error:
    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1]

    Only using permalink!

    I get the “write-enabled” error using my current blog or the new test one.. when trying to use the plug-in. The folders are write enabled though

  25. John

    When the update is processed does the code point to a particular blog structure or or is it written in such a way that the actual structure (where wordpress is installed) does not matter. I still get errors when using permalink or the plugin although everything else is fine.

  26. So this seems to be all related and here we go.

    After activating permalinks (which works) this error pops up at each page though the page loads fine:

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
    SELECT category_nicename FROM wp_categories WHERE cat_ID=

    Also when clicking “Uncategorized” at:
    Posted on September 10th, 2005 in Uncategorized. 1 comment.
    I get a “404” page not found

    I still get an error when trying to update the style using the plugin that tells me the theme folder may not be writeable but is not the case. This is not of real importance to be as I like the theme as is but may be related to the above.

    If anyone has any ideas on these issues please let me know. It’s driving me nutz!

    Thanks in advance.

  27. Hi Ronnie. The write permissions error may be caused by a very security-consious host. Try setting the write permissions for both the directory and all the files inside it.

    Do permalinks work for you with another theme? The function that is causing the error you described is not directly called by the Giraffe theme. Permalinks often cause problems on hosts where there are write-permission problems or the .htaccess URL rewriting is not working properly. If you disable permalinks and everything works fine then check the permissions on the .htaccess file.

  28. The problem was a result of the differing configurations of PHP that web hosts install. Your particular host doesn’t seem to have set the search path, which is what tells PHP where to find files. As such the header file couldn’t find the giraffe.php file, even though it was in the same directory. I changed it so that it specifically looked in the same directory.

  29. Actually permalinks works fine on my present theme. Only when I turn them on with Girraffe do I get the error. I have the theme installed in a test directory and have actually tried making every theme file and folder writeable. Same with .htaccess

    Oh well…

  30. Very nice theme, I really like the plugin controls! SO far I have mode one addition which is to change the_content to the_exceprt in the index. I figured out I had to change in the plugin or it would get overwritten with changes.

    I woud lliek ot make a request for a future version. In the control, please offer options for date formatting. I just noticed that the site says “Older posts: 12/05/2005.” I assume this is European formatting because we haven’t written any posts in December 2005 yet!

    I can change this myself in the template, but the users I setting this up for can’t. This would be very simple to add to the theme options page.

    Thanks again. This is great work!

  31. I’m pretty new at this stuff, kept on getting errors when i try to change the options in the giraffe theme. how do i make thetheme directory and file writeable? also, can I change the bar at the top? without th giraffe?

  32. Install the Giraffe plugin (at the top of this page) and you will have an extra menu in the WordPress administration screen. From there you can change the colour scheme.

  33. Hey John, Sweet theme man…its sexy and perfect for what I need. BUT, its generating an error that I cant seem to figure out.

    Warning: Failed opening ‘giraffe.php’ for inclusion (include_path=”) in /home/sites/site18/users/sb.neil/web/wp-content/themes/giraffe/header.php on line 1

    I’ve installed WP with various themes a number of times before without problem (although never on this server)
    Server: PHP Version 4.1.2 | Apache

    Also not sure if its relevant but I’ve changed all the CHMOD permissions on those files mentioned in the install instructions to make them all writable, i.e.- 666…

  34. Hi John,

    I love the theme editing plugin. I love it better when I can get it to work. Here’s the error I am getting “Problem updating files – is the theme directory write-enabled?” I have given read write permission to everything on the server. Hummmm.

    I am hoping you can help!
    Andrea

  35. Andrea: Somewhere there has to be a file or directory with incorrect permissions. Some web hosts can require the permissions to be given to ‘group’ or ‘other’, not just the user. Try setting the permissions in the giraffe directory to 777

  36. Neil0r: Are you using the latest version of the theme? This problem has been mentioned before in the comments here, and I should have fixed it in version 1.19

  37. Kosh2: I’m not sure why, but the HTML for your page has <id=" page">, when it should be <id="page"> – notice the extra space. So what is happening is that the browser cannot match the style for the page to the item in the HTML.

    Quite why this space has appeared I don’t know. It’s not in the theme itself, so maybe it was introduced when transferring over FTP. Either way you can fix it by removing the space from header.php yourself, or re-downloading the theme and transferring header.php over your existing file.

  38. is there any way to add a link to thetop navigation bar. I want to add in the link to my gallery2 along with the pages links but can’t figure out how.

  39. How are you implementing switching between localized versions of the theme on the fly? I’d basically like to provide the localization menu you have here. Any way you could add this as an option to your plugin script? (Apologies if it’s somehow in there already and I’ve missed it…)

  40. Kosh: Unless you configure it otherwise, the links in the top menu are WordPress pages. If you want to add a new link you can just create a new WordPress page and insert the relevant details there.

  41. Ann: Google does indeed see and know all. The localization menu is going into the next version of the theme anyway (although don’t let Google know just yet), probably with a bit more customisation options.

  42. Dear John, I really like your template and I would like to use it for my blog site but I have a big problem with your plugin. I followed your instructions to install it, I use the last version of wordpress 1.5.1.3. I saw also the wp-l10n.php in wp-includes and it includes the function: Fatal error: Call to undefined function: load_theme_textdomain() in ….wordpress\wp-admin\giraffe\giraffe.php on line 11 . I just unzipped the giraffe-plugin file in wp-admin because after I active the plugin on my panel control and I go to option – giraffe theme the screen show me another error because it doesn’t exist the file giraffe.php on wp-admin/giraffe.. so I installed also there the plugin but on line 11…crack.
    Can you help me ? OSrry for my english but I’m Italian and I’m not so practice to write in english.
    Thanks

  43. hey, I just get
    “The requested URL /wp-admin/giraffe/giraffe.php was not found on this server.” when I try to access the giraffe-plugin options settings, probably because I did not copy any files into teh “wp-admin”- section (neither theme-files nor plugin-files).

    is this just me or is it a bug ?

    cheers, Grinch

  44. John,

    Your Giraffe theme is beyond excellent, thank you for making it available to us.

    I have 1.19 on my site, edited to my liking, and was wondering if this new version (1.20) had any major chages?

    I looked at the new php files (didn’t install) and I saw new options for a random logo, locale switcher and a few layoutX.png files. What are the changes John?

    Cheers

  45. Most of the changes are in the admin interface. A full list can be found here. If you want to give it a try you can make a copy of your existing giraffe directory, just in case the new theme changes your modifications!

  46. I plainly copied your example for editing the top navigation bar, but nothing happened. Is there a tiny typo, or is something else than refreshing the page required?

  47. Not as far as I can tell. I copied the code directly from this webpage and put it in wp-content/themes/giraffe/giraffe_functions.php. I then refreshed the page and the navigation bar contained the two choices in the code.

  48. Blimey. It works. Soory foo beein stoopid. Come to think of it, there is one possible source of error: I used the WordPress editor (chmod set to 666 for the functions file), but it didn’t seem to update after editing. But this one works, though. Thanks!

  49. i selected the show calendar option, but it is not showing.

    also, installed ja.mo as instructed, but won’t switch back to english. have the line in wp-config.php as: define (‘WPLANG’, ‘ja’);

  50. Small bug in the code prevented the calendar being displayed – try version 1.22. To revert back to English change the wp-config.php line to be: define ('WPLANG', '');

  51. I suggest you to change the query in giraffe_comments() from

    $comments = $wpdb->get_row (“SELECT count(comment_author) FROM $wpdb->comments WHERE comment_approved=1″, ARRAY_N);

    to

    $comments = $wpdb->get_row (“SELECT count(comment_author) FROM $wpdb->comments WHERE comment_approved=’1′”, ARRAY_N);

    that is to quote the number 1.

    In my local site I use mysql 5.0 and the original query return always 0.

    Bye

  52. When I click a category view I have the following error:

    Fatal error: Only variables can be passed by reference in /home/user/local.mysite.it/blog/wp-includes/classes.php on line 629

  53. I changed the line 629 of /wp-includes/classes.php from:

    $category = &get_category($this->get(‘cat’));

    to:

    $tmp = $this->get(‘cat’);
    $category = &get_category($tmp);

    and now works. I had the same problem with other things (for example the wp gettext wrapper for internationalization) and I suspect this is a php 5.x issue.

    Bye

  54. This theme seems interesting, as there are not too many fluid themes for WordPress. Thanks for your work!

    However, I have a problem. Having copied the giraffe directory into the plugins directory the WP administration environment of mine stops working. I.e. whichever administration page (or even the main blog page) I try to acces, all I get is an empty white page (I have tried several browsers).

    When I then remove the giraffe directory from the plugins, everything works well, except for the plugin, of course.

    This happens with the newest version 1.2.3 and a fairly new version of WP (1.5.2).

  55. Giraffe seems to work nicely under WP 2.0 too, which is good news.

    One thing I’ve added to my copy is a Next Post/Previous Post link on the single.php page so that users can easily navigate through posts chronologically. There may be another way of doing it but I couldn’t see anything obvious.

  56. Hey John, thanks for your wonderful theme and plugin. I think in the customization plugin, you should include page (as in the “write static page option”) customization. Thanks again…

  57. Very nice theme. Possible bug though: the “Show icon for external links” option doesn’t seem to do anything; the links get icons whatever I set this to. I am using WordPress 2.0.

  58. I’ll be releasing a new version soon which will fix some of the small bugs as well as being fully 2.0 compatible (it currently works fine, but the theme is doing a lot of work that 2.0 itself can do).

    Ughly: You need to change the blog address from the WordPress administration screens (under Options)

  59. Hello, I am new to wordpress themes but think I’m pretty proficient at editing them and figuring out what to do. I very much enjoy your theme and your tutorials. However, I am having difficulty with the giraffe plugin. I have unzipped it and copied it to my plug-in folder via an ftp program. For some reason, the plug-in does not show up as an option on my plug-in page in the admin area. Do you have any idea what I could be doing wrong?

  60. Hi Candace, did you upload the plugin as a directory? Inside your /wp-content/plugins directory there should be a ‘giraffe’ directory, inside which are all the plugin files.

  61. Hey, a suggestion for your next version : When the options are edited using the plugin, all files are overwritten, and all things that I configured(eg. : ads on the post page, custom cursor via css) etc. were lost.
    So, if theres some mechanism to edit the current files, without overwriting, it would be cool. One way to do it would be to just take the source from the file itself.
    Thanks,
    Mohan

  62. Awesome, awesome, awesome.

    Can’t get the RANDOM feature to work.I get no error messages or anything it’s just me images in the logo folder don’t show up at all.

    Thoughts?

    Thanks,

    Jude

  63. i realize that there must be a simple fix for this, but i can’t seem to figure it out…

    i’d like to remove my links from my sidebar, but keep them visible on my links page that i’ve created using a plugin on a static page. i can’t figure out how to cut them out of the sidebar. there doesn’t seem to be a “get links” function in sidebar.php, so i’m not sure what i need to remove to stop them from showing up there.

    any help would be much appreciated!

  64. The links are in this bit of code:

    <?php if ( is_home()) { ?>
    <?php get_links_list(); ?>
    <li><h2><?php _ge(‘User’)?></h2>
    <ul>
    <?php wp_register(); ?>
    <li><?php wp_loginout(); ?></li>
    <?php wp_meta(); ?>
    </ul>
    </li>
    <?php } ?>

    Delete that line and they will disappear.

  65. Hey All,

    How do I get the author of the post to show up? I realize there are various bits of code for this but I am unsure which one to use and importantly where in my theme/giraffe/index.php to put it?

    Cheers,

    Jude

    PS: I have tried several times unsuccesfully….should have paid more attention in class.

  66. I have put the code in various places but no matter what I do my formatting gets messed up. Additionaly if I update anything on the options page anything I have done manually disapears. The format being messed up isn’t the end of the world so I have left it as is for now. Feel free to check it out.

    http://www.broley.org/

    Cheers,

    Jude

  67. Hi John,

    two questions:
    (1) Additional CSS
    I’m using additional CSS to format parts of my pages. Everytime I update the options using your giraffe management plugin, the CSS changes in style.css are lost.
    I’m quite new and unexperienced in css, so do you have a quick-tip how to keep my own css?

    (2) Language Switch
    This does not seem to work in my staging environment (WAMP 1.6.1, I’m using it based on your great tutorial! Thanx & kudos for that!!).
    Am I right that the user is supposed to switch the theme’s (and thus the blog’s) language by one click? I don’t care about the post/page content, as I will write in English and German, but changing the UI would be great!!

    The second issue is more important to me, I can live with the current css management as I won’t update giraffe too often in production.

    Either way, my two (maybe three) websites will sing out loud the “urbangiraffe is great” message! :-)))

    Many thanx for your help!!
    With kind regards,
    Volker

  68. Hi Volker, thanks for the message! You can put your CSS in ‘extra.css’. This is not touched when you update the options.

    As for the language switch, I might not have made this clear at all, but you need to modify wp-config.php – this is explained in another post.

Pings

vidadigital.net | vidadigital.net | ruscibar.it | blog.taragana.com | zyblog.de | zyblog.de | emilyrobbins.com | adirondackbasecamp.com

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>