// The theme functions
/* ================================================================
DEFINE BASICS AND INCLUDE REQUIRED FILES
================================================================ */
define( 'TEMPPATH', get_stylesheet_directory_uri() );
define( 'IMAGES', TEMPPATH. "/img" );
add_filter( 'show_admin_bar', '__return_false' );
add_filter( 'ot_theme_mode', '__return_true' );
include_once( 'option-tree/ot-loader.php' );
include_once( 'includes/et_theme_options.php' );
include_once( 'includes/et_options_backup.php' );
include_once( 'includes/et_shortcodes.php' );
include_once( 'includes/et_theme_functions.php' );
/* ================================================================
NAV & TITLE SETTINGS
================================================================ */
// Sanitize title
function et_page_title() {
$post_data = get_page($page->ID, ARRAY_A);
$title = $post_data['post_title'];
$chars = array("[color]","[/color]","","","
","
");
$substitute = array("");
$unwanted_array = array( 'Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',
'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U',
'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c',
'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o',
'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y','Ğ'=>'G', 'İ'=>'I', 'Ş'=>'S', 'ğ'=>'g', 'ı'=>'i', 'ş'=>'s', 'ü'=>'u',
'ă'=>'a', 'Ă'=>'A', 'ș'=>'s', 'Ș'=>'S', 'ț'=>'t', 'Ț'=>'T' );
$anchor = strtr( $title, $unwanted_array );
$anchor = str_replace($chars,$substitute,$anchor);
$anchor = str_replace(" ","-",$anchor);
$anchor = preg_replace('/[^A-Za-z0-9\-]/', '', $anchor);
$anchor = strtolower($anchor);
return $anchor;
}
function et_register_menus() {
register_nav_menus( array( 'top-menu' => 'Top primary menu') );
} add_action('init', 'et_register_menus');
class description_walker extends Walker_Nav_Menu{
function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0){
//global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
$class_names = ' class="'. esc_attr( $class_names ) . '"';
$output .= $indent . '