Showing posts with label WordPress. Show all posts
Showing posts with label WordPress. Show all posts

Monday, September 29, 2014

Change WordPress Language in Theme

If using _e("Hello","textdomain"); to translate theme you need to create an es_es.po file in text editor:

msgid ""
msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"Project-Id-Version: Theme Name\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: Mike <w@w.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: es_ES\n"
"X-Generator: Poedit 1.6.9\n"
"X-Poedit-SourceCharset: UTF-8\n"

#: ../header.php:58
msgid "Hello"
msgstr "Hola"

Compile it with POEeditor you will get file es_es.mo. Upload both files
/wp-content/themes/{yourTheme}/languages

in functions.php add

add_action('after_setup_theme', 'my_theme_setup');
function my_theme_setup(){
    load_theme_textdomain('textdomain', get_template_directory() . '/languages');
}

In WP backend change language to Spanish. And both your theme and WP backend will be in Spanish. You can use plugin to leave backend in English.

Saturday, August 9, 2014

WordPress Pagination and Search in Backend

This an advanced WordPress tutorial about plugin that creates and searches a table in database. All that is happening in WordPress backend. This is useful when you need to see what your visitor have submitted to you in contact form.


After plugin activation populate table tablePrefix_messages with some

Saturday, June 1, 2013

Most Frequent WordPrees actions and shortcode

To follow this tutorial you need to know WordPress basics about plugins and shortcode.
Just replace the Hello Dolly plugin with this code:

Friday, May 31, 2013