Skip to content

Instantly share code, notes, and snippets.

@marcelotorres
marcelotorres / functions.php
Created November 26, 2016 14:47 — forked from grappler/functions.php
Loading theme and plugin translations in WordPress - https://ulrich.pogson.ch/load-theme-plugin-translations
<?php
function theme_name_setup(){
$domain = 'theme-name';
// wp-content/languages/theme-name/de_DE.mo
load_theme_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain );
// wp-content/themes/child-theme-name/languages/de_DE.mo
load_theme_textdomain( $domain, get_stylesheet_directory() . '/languages' );
// wp-content/themes/theme-name/languages/de_DE.mo
<?php
add_theme_support('menus');
/*
http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus(array(
'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
'top-bar-r' => 'Right Top Bar'
));