How to Create Favicon (.ico) with GIMP under Linux?

Posted January 14th, 2011 in linux, setup, theme, wordpress by Dainius

Favicon file is placed in a web server root directory. It is a page icon or associated with a particular website. For example when you visit our site you see favicon in the browser's URL bar, next to the site's name. Also it appears next to the site's name in lists of bookmarks, and next to the page's title in a tabbed document interface.

When you building new website, to distinct from others you need your logo and favicon. Directly with GIMP you can save .gif, .jpg or .png files which is not bad, but users with MS Internet explorer from Windows can only see blank sheet of paper where your branding should appear.

Under windows you can save file as .ico directly from GIMP. If you working from linux, you should have both GIMP and netpbm.

To get these installed, you should run

[code]

$ sudo apt-get install netpbm gimp

[/code]

in your terminal.

Step # 1: Convert logo to ppm raw format

  1. Open your logo using GIMP
  2. Now cut and paste logo in square
  3. Next resize logo by visiting Image > Scale image option. Set pixel size to 16 x 16 or 32 x 32 or 48 x 48.
  4. Next click on File > Save as > Enter file name as favicon.ppm > Click on Save > Raw Encoding > Ok

Step # 2: Convert portable pixmaps into a Windows .ico file

Now run the following command to create a .ico file:

[code]

$ ppmtowinicon -output favicon.ico favicon.ppm

[/code]

Step # 3: Upload favicon.ico file

Upload favicon.ico file to webserver root directory such as /var/www/html or /srv/httpd/kurapka.lt.

Step # 4: Favicon example

To activate favicon, modify your site pages or template by placing following code between <head>...</head> section:

[php]

<link rel="icon" href="<?php bloginfo('template_url'); ?>/favicon.ico" />
<link rel="shortcut icon" href="<?php bloginfo('template_url'); ?>/favicon.ico" />

[/php]

if your favicon.ico is in root folder.

Create Page Template for Your WordPress Theme

Posted January 9th, 2011 in wordpress by Dainius

Sometimes you need to display certain pages of your blog in totally different way than other ones. To create your own template create an empty file and save it using proper name, for example  myarchivetemplate.php

You should start from the most important five lines:

[php]
<?php
/*
Template Name: My New Template
*/
?>
[/php]

Now you can build your page structure, upload in your theme folder and you should see drop-down box selection for page when you create or edit one.

Before considering to create completely new template for different certain page display you can explore other ways, like styling or if statements.

Some short and dirty example with CSS, which hide your sidebar in "My bio" page:

[css]
#sidebar{
display:none;
}
[/css]

Also you should arrange other page elements, like content etc. and save styles in separate file, let's call it mybio.css

In page.php you should call this style if you are on your Bio page:

[code]

<?php if (is_page(‘my-bio’)) { ?>
<link rel=”stylesheet” href=”mybio.css” type=”text/css” media=”screen” charset=”utf-8″ />
<?php } ?>

[/code]

Also you can find other applications of function is_page at WordPress Codex.

REMEMBER: always make proper backups of your files before hacking!

Vote for Lithuanian Candidate in Davos

Posted January 8th, 2011 in offtopic by Dainius

It's very simple. Just do step by step instructions from picture. Login required to vote. Don't forget to share these instructions with your friends!

Thank you for support!

Serve Your Readers What You Want via RSS

Posted January 8th, 2011 in setup, wordpress by Dainius

WordPress is easy to tweak it out. And WordPress has good support on Feed. Sometime we need to insert custom content into our WordPress Feeds. On this post you will learn how to Insert Custom Content into Feeds. The custom content can be anything – text, markup, pictures, or even scripts – and may be set to appear in blog posts, feed posts, or both. You can easily manipulate content to be displayed before or after your post content, or in both places.

[php]

function doContent($content) {
$content = $content . '<p>Write Down your custom content here!</p>';
return $content;
}
add_filter('the_excerpt_rss', 'doContent');
add_filter('the_content_rss', 'doContent');

[/php]

Note, the code above will insert extra content after you the_content_rss(); or the_excerpt_rss(), so if you display this code in you standard theme, the regular content will be displayed too. So beware when you tried code to Insert Custom Content into RSS Feeds.

Awesome Resources to Learn Computer Languages for Free

Posted January 8th, 2011 in programming by Dainius

Would like to learn programming language sitting comfortably at home, near your computer?

Then these FREE resources for you:

The Computing section on Wikibooks deals with books on Computer Languages as well as other related books.
LandofCode offers tutorial based courses in languages ranging from PHP to scripting languages like HTML. Offers a Real-time code editor to let you see how your code works.
With courses in HTML 5, AJAX, jQuery and much more, WebMonkey is the right portal for you to learn quick.
W3Schools is a popular portal among the student community to learn languages in Web and Multimedia domain through easy tutorials. You can test HTML and CSS on site.
Free-ed College of Computers & Information Technology provides courses in many languages such as Visual Basic, C++, ASP and even Perl.

Page 5 of 13« First...34567...10...Last »