WordPress MultiLanguage CMS Plugin

[HTML1]

This post is outdated – please read my advice for multilingual WordPress here:

http://www.matteoionescu.com/wordpress/qtranslatemeta/


I saw lots of interest for this subject – Hey ,  Matt, isn’t it time for WordPress to get multilingual?

I wrote this simple plugin just because I hated most other solutions, that proved very cumbersome and not very clean – but lately  I’m experimenting with good success the new version of the qTranslate plugin wich incorporates much of the desired functionality, and some more bells and whistles, while keeping installation simple:

http://www.qianqin.de/qtranslate/
So this plugin may be a better option for you. I’m going to focus on making qTranslate more SEO!

This is a plugin to turn WordPress into a simple MultiLanguage CMS.

There are other plugins to do so but this one is very light, easy, basic, easily hackable and SEO-friendly.

It has some limits, but it can be perfect in order to use WordPress as a multilanguage basic CMS. Perfect for a multilanguage company website or anything else not too complicated.

The plugin only handles pages. Posts are still there, but the same old way:only in the main language.

The idea behind this simple plugin is that basically,  the navigational structure of a multilanguage website looks anyway like a tree, and so it can be perfectly matched via the WordPress standard Page Parent mechanism.

The only problem would be that your theme would obviously list pages in your navigational menus without discerning the language. So we need to introduce a new function to do it properly. That’s what the plugin is mainly for. Don’t worry, it’s very easy to setup once you understand the basic idea!


[HTML1]

First, some good news: if something goes wrong and you don’t like this plugin, remember that it does not alter any table of your precious wordpress install. We’re in beta, after all. But I have many websites happily running this plugin.

To make the plugin work, you need to hack your theme just a bit in order to use the new function to list pages, wich will   show only pages in the current language, and to insert the classic language switch links/flags. Backup your theme first, and then start hacking!

Main features and requirements:

  • English, French, Deutsch, Italian, Dutch and Spanish supported
  • Handle easily the website’s architecture via classic Parent Page WordPress feature, very intuitive and decently easy to maintain for simple websites!
  • The plugin assumes you want English as the default language (this can be easily changed)
  • We  assume  your website has English pages before starting the tutorial
  • The plugin will NOT change the URLS of your English pages. This is good news for the search engines!
  • Permalinks MUST be enabled (your page’s URL should look like www.domain.com/page-name, NOT www.domain,com/?p=15. (If permalinks are not enabled, the mlg_links function will not work, and you’ll have to do some easy homework manually placing in your theme links to the the foreign homepages)


Get started

Install this preliminary great plugin: is_child. Activate the plugin.This is needed in order to make everything work. MultiLanguage CMS will break your theme if is_child is not installed and active!

Now, download and install the Multilanguage CMS plugin:

Your Email:   

After downloading, activate the plugin. No configuration necessary here. Now take a deep breath and go on!

Hack your WordPress Theme to call the new template tags!

That is very easy but needs a bit patience for the newbies. Some minutes, shouldn’t be more! You just need to know how to use an FTP client and a text editor.

Typically you’ll have to edit your  header.php (or more files) in the active Theme folder.

In this file, substitute the standard wp_list_pages function with the wp_mlg_list_pages function, introduced by the plugin.

If you’re designing your own wordpress theme, grab this code as a starting example  – paste it where you want the main menu to appear:

<ul><?php  wp_mlg_list_pages(‘&title_li=’); ?></ul>

And then decide where do you want to put the language switching standard navigation links. Somewhere in the header, right? Or maybe in the sidebar ? (SamsarinPhpWidget would be handy)

Just call the mlg_links function -  copy and paste this code wherever you want the language switching links to appear:

<?php mlg_links(); ?>

This function simply  echoes some links, showing only languages that have at least a page. Continue reading!

How to add a new language – handling the languages in the WordPress admin panel

We  assume  your WordPress website has already pages for the main language (typically English).

So let’s see how to add a language! Be careful to follow the instructions precisely and it will work in a snap.  Pay attention to lowercase / uppercase – we have some case sensitive stuff here.

  • Create a new page (for the new language homepage), add some content
  • In this page, create a custom field called mlg_home and set value to the abbreviation of it’s   language (it for Italian, de for deutsch, nl for Dutch, es for Spanish, fr for French…) (this explains to the plugin that the current page will be the homepage of the specified language) VIEW SCREENSHOT
  • Publish the page
  • For SEO: Re-edit the page and set the page slug to the abbreviation of the new language (it for Italian, de for deutsch, nl for Dutch, es for Spanish, fr for French…) so the URL will be pretty VIEW SCREENSHOT
  • To add more pages in that language: Create page, add content, and select the right language’s home page in the Page Parent select. So you are putting new pages in their right place in the ideal tree architecture of the web site.

You’re done! If you did everything well, you’ll see that a new link is born for the new language (printed by the mlg_links function), and clicking this link you should see only pages of that language listed by the wp_mlg_list_pages function you’ve added before.

How do I disable the plugin? What, the theme breaks?

If you want to disable the plugin, make sure you revert the theme hacks BEFORE – otherwise your theme will break. This is why I advide you to backup your theme before installing the plugin. Anyway, it’s not a great problem: You’ll still be able to enter the wp-admin if you’re stuck in  such a situation – just reactivate the plugin and everything will come back to life. This happens because you are calling a function wich is not defined. You could easily avoid that using if function_exists – but I wanted to keep the code as elementary in the example.

is_child WordPress Plugin

I want to thank you Erik Range, the author of this great plugin wich has helped me a lot of times: is_child

Unfortunately the developer’s site (http://erik.range-it.de/) is down. So I’ll host this one for all of you who haven’t used it yet – if Eric is not offended – those lines of code are way too precious to get lost!


Download latest 1.1.2 is_child plugin


What is this for?

Useful for template designers. This plugin checks if current page, posting or category is in direct or recursive relation with a specific parent category or parent page.

Examples:

———————————————————————
Examples:
———————————————————————
–>    is_child( 10 )
Checks if the current page, posting or category is somehow
related to category- (or page-)ID 10.

–> is_child( “Example Category”, false )
Checks just if the current element is a direct child of “Example
Category”.

–> is_child( “some-page”, 1 )
Checks if the current element (page) is somehow related to a page
with the slug “some-page”.

Mac VS PC Widget for WordPress

As I recently blogged about, there are many good reasons to switch to Mac.

switch to mac tv spot

If you are a WordPress blogger, why not endorse the Mac cause showing off you’re a proud Mac user?

This widget will greet your site visitors differently:

- PC users will see this:

switch to mac wordpress widget

-  Mac users will see this:

switch to mac

So this is just a funny widget – but I hope it can help many people discover the beauty of the Mac Os.

Get this  Widget and try it on  your WordPress blog! After all, it’s free :-)

In order to get the widget, insert your email address. You will receive instantly an email with the download link.

Your Email:   

I’ll contact you occasionally regarding WordPress plugins and updates – I won’t use your email for any other purpose, or sell it to anybody.

Google Chrome – A smart user interface

I’m testing the new Google Chrome browser. It is only available for Windows right now, but the Mac version should be soon available.

It feels very fast when browsing pages, and the user interface has many useful new features.google chrome

Safari,  IE and Firefox share pretty much the same user interface and features. Google Chrome seems a bit forward introducing some new flavour in browser user interfaces. Tabs where the only real addition since the days of Netscape Navigator…imho!

What I really enjoy is the fullscreen mode. If you maximize the application window, tabs will stick to the upper edge of the screen, helping you easily reach with your mouse: corners and sides of the screen are always easier to reach, because there’s no risk of “overshooting” the target…

What I didn’t like too much is that Chrome has it’s own look and feel and doesn’t inherit much of your OS standard look – I really think that applications should stick with OS consistency, especially when designing a browser – except when there are very special user interface interaction patterns / user needs (Serato Scratch Live?)

I strongly recommend you to test drive Google Chrome! Let’s hope to have it soon on the Mac too.

The only downside: from today web developers need to test their work on Chrome too!

10 reasons why you should switch to Mac, especially if you are a WordPress blogger

Yes, another ironic Mac vs PC post.

WordPress bloggers love the Mac. That’s a fact. Why? It’s easy. Because they don’t like to waste their time!

I’ve used Macs and PCs for almost 20 years, so I’ll try to point   out some of the top reasons why you should switch to Mac:

switch

  1. Macs don’t need an anti-virus software. And anti-virus software is a BAD thing!
    Think at it….Anti-virus software…is a virus:
    - It slows down a bit your computer, wich will continuously run some virus monitoring processes
    - It wakes up by itself trying to desperately update it’s virus database, slowing down your computer even more and consuming bandwidth (wich is not always free especially if you’re accessing the Internet via mobile modem)
    - It socially spreads itself: every PC user is aware that anti-virus software is necessary.
    - It costs you money every year that could be spent elsewhere. What kind of satisfaction do you get in purchasing an anti-virus?
  2. Macs run Windows, if you need to. PCs are not able to run Mac Os.
    Unless you heavily patch MacOs, illegally.
    Mac hardware is very similar to your average PC – but it allows to run natively Windows and Mac Os. If you buy a Mac and end up disliking the Mac Os, no problemo.
  3. Macs cost you less money when you need to upgrade them.
    If you know Moore’s Law, you can easily understand that the best way to upgrade your computer….is to replace it with a new one! And selling your one year old Mac will be very easy. Selling your old grey PC, or even your shiny laptop pc, with the   endless combination  of models available,  won’t be as fast, and you’ll recover a lower percentage of the initial investment. I change my Apple laptop every six months since 5 years ago. This costs me around 20% of the retail price. Try to do the same with a PC.
  4. Most decent software is available for the Mac OS. Most crap is ony available for PCs.
    If you ever had a chance to see what the average guy’s PC looks like, you might have seen tons of useless search bars, widgets, useless crap applications wich fall into the spyware category.
    The average guy’s Mac is only filled with documents on the desktop.
  5. Macs read your PC documents on your external USB drive.
    This makes moving documents very easy.
  6. If your Mac has a firewire port, guess what. If you press the T key while booting, the Mac itself turns into an external firewire hard drive.
    This feature is fabulous – very handy for moving huge loads of data from two laptops with just a firewire cable – and it’s there in every single Mac…since almost 10 years. Quite a long time. I’ve yet to see a PC doing this. And if a PC will ever be able to do so, it won’t be YOUR PC. Why? Murphy’s law is always around, you bet it!
  7. Macs double up as a media center that – guess what – simply work out of the box.
    Just purchase the 20$ Apple Remote. Connect your Mac to your TV via HDMI, and you just have a free Apple TV! But I wanted to get one, and you might want it as well, if you don’t like to move your Mac around your house.
  8. The Mac Os requires NO WEIRD ACTIVATION PROCEDURES,
    and doesn’t make you a single question during the operating system installation process. Strange but true if you’re used to Windows.
  9. Less dumb questions.
    I bet you don’t like people who make dumb questions. How can you enjoy the Windows OS? Installing applications on Vista, or removing them, is a much longer process than on a Mac, where dragging an icon is the single thing you need to do in most cases. And what about removing an application? Drag it into the trashcan.
  10. Carbon Copy Cloner
    A free Mac app wich can make a bootable copy of your drives – so easy you’ll be surprised coming from Norton Ghost or similar PC software. This means that making a full bootable backup of your drive is an easy task you’ll end up doing much more often, with great effects on your mental health in case of hard disk failure. Remember, hard drives are never 100% reliable, so better be safe than sorry! We forget too often that our beloved machines are not perfect. Have you ever seen Brazil?

I hope this list can be useful to some switchers in order to give it a try! Your mind deserves MacOs, believe me.

PostIt WordPress Plugin

Sometimes you want to put some content in a static  box as shown here:

This content goes in a box. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam vehicula sodales mi. Sed fermentum. Sed fermentum malesuada massa. Vestibulum massa. Donec fringilla augue et nisl. Suspendisse potenti. Etiam mi. Fusce luctus sagittis sem.
But sometimes you may need to expand on a subject and allow your readers to  read more...
More about this subject
Yes, read more. With this plugin you will be able to insert additional content wich is displayed upon clicking a “read more” link.
but you don’t want to dedicate a whole new post or page on it. This is not   easy to do in WordPress. This is why I’m developing a new Plugin. I’m still tweaking the user interface, so hold on tight.

EmbedIt WordPress Plugin – Embed HTML code in WordPress without problems!

[HTML3]
images.jpgDo you need a SIMPLE plugin for incorporating any HTML code (including Youtube, Metacafe, Ustream.tv html embed code) into your WordPress posts? WordPress 3 compatible?

How many times have you been feeling frustrated because the WordPress built in WYSIWYG editor would destroy your HTML code, no matter what you do?

This light and easy wordpress plugin will solve your problem. Continue reading