P. 1
WORDPRESS THEME Referance

WORDPRESS THEME Referance

|Views: 304|Likes:
Published by jwzumwalt
Wordpress referance based on an excellent theme building guide. Includes customization tips and a complete function referance.
Wordpress referance based on an excellent theme building guide. Includes customization tips and a complete function referance.

More info:

Published by: jwzumwalt on Apr 25, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/15/2015

pdf

text

original

Open up your functions.php file. We’re going to add two helper function there, that’ll come in handy
when we’re creating the document title.

Your functions.php file should look like this…

// Make theme available for language translations
// Translations can be filed in the /languages/ directory
load_theme_textdomain('your-theme', TEMPLATEPATH . '/languages');
$locale = get_locale();
$locale_file = TEMPLATEPATH . "/languages/$locale.php";

if (is_readable($locale_file))
require_once($locale_file);

// Get the page number
function get_page_number()
{

if (get_query_var('paged')) {
print ' | ' . __('Page ', 'your-theme') . get_query_var('paged');
} //get_query_var('paged')
} // end get_page_number

?>

Listing 5.1

The first function tells WordPress we want to make our theme available for translation and that
translation files can be found in our theme folder in a folder called “languages”. If you’re going to
create a WordPress Theme you should always try your best to make sure everything is translatable.
You never know when someone else is going to need hard-coded content available in another
language.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->