Example #1
0
		
				</div>
			</div>
			<div id="gk-header-nav">
				<div class="gk-page">
					<?php 
if (get_option($gk_tpl->name . "_branding_logo_type", 'css') != 'none') {
    ?>
						<a href="<?php 
    echo home_url();
    ?>
" class="<?php 
    echo get_option($gk_tpl->name . "_branding_logo_type", 'css');
    ?>
Logo"><?php 
    gk_blog_logo();
    ?>
</a>
					<?php 
}
?>
					
					<?php 
if (gk_show_menu('mainmenu')) {
    ?>
						<?php 
    gavern_menu('mainmenu', 'main-menu-mobile', array('walker' => new GKMenuWalkerMobile(), 'items_wrap' => '<i class="fa fa-bars"></i><select onchange="window.location.href=this.value;"><option value="#">' . __('Select a page', GKTPLNAME) . '</option>%3$s</select>', 'container' => 'div'));
    ?>
					<?php 
}
?>
Example #2
0
/**
 *
 * Function used as real die handler
 *
 * @param message - message for the error page
 * @param title - title of the error page
 * @param args - additional params
 *
 * @return null
 *
 **/
function gavern_custom_die_handler($message, $title = '', $args = array())
{
    if (!defined('GKTPLNAME')) {
        define('GKTPLNAME', 'MeetGavernWP');
    }
    $defaults = array('response' => 404);
    $r = wp_parse_args($args, $defaults);
    $have_gettext = function_exists('__');
    if (function_exists('is_wp_error') && is_wp_error($message)) {
        if (empty($title)) {
            $error_data = $message->get_error_data();
            if (is_array($error_data) && isset($error_data['title'])) {
                $title = $error_data['title'];
            }
        }
        $errors = $message->get_error_messages();
        switch (count($errors)) {
            case 0:
                $message = '';
                break;
            case 1:
                $message = "<p>{$errors[0]}</p>";
                break;
            default:
                $message = "<ul>\n\t\t<li>" . join("</li>\n\t\t<li>", $errors) . "</li>\n\t</ul>";
                break;
        }
    } elseif (is_string($message)) {
        $message = "<p>{$message}</p>";
    }
    if (isset($r['back_link']) && $r['back_link']) {
        $back_text = $have_gettext ? __('&laquo; Back', GKTPLNAME) : '&laquo; Back';
        $message .= "\n<p><a href='javascript:history.back()'>{$back_text}</a></p>";
    }
    if (!function_exists('did_action') || !did_action('admin_head')) {
        if (!headers_sent()) {
            status_header($r['response']);
            nocache_headers();
            header('Content-Type: text/html; charset=utf-8');
        }
        if (empty($title)) {
            $title = $have_gettext ? __('WordPress &rsaquo; Error', GKTPLNAME) : 'WordPress &rsaquo; Error';
        }
        $text_direction = 'ltr';
        if (isset($r['text_direction']) && 'rtl' == $r['text_direction']) {
            $text_direction = 'rtl';
        } elseif (function_exists('is_rtl') && is_rtl()) {
            $text_direction = 'rtl';
        }
        ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <?php 
        if (function_exists('language_attributes') && function_exists('is_rtl')) {
            language_attributes();
        } else {
            echo "dir='{$text_direction}'";
        }
        ?>
>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title><?php 
        echo $title;
        ?>
</title>
	<link href="<?php 
        echo gavern_file_uri('css/error.css');
        ?>
" rel="stylesheet" type="text/css" />
</head>
<body id="error-page">
<?php 
    }
    ?>
	<div class="gk-page">
		<div id="gk-page-top">
			<?php 
    global $gk_tpl;
    if (get_option($gk_tpl->name . "_branding_logo_type", 'css') != 'none') {
        ?>
				<a href="<?php 
        echo home_url();
        ?>
" class="<?php 
        echo get_option($gk_tpl->name . "_branding_logo_type", 'css');
        ?>
Logo"><?php 
        gk_blog_logo();
        ?>
</a>
			<?php 
    }
    ?>
		</div>
		<div id="gk-page-wrap">
			<div id="frame">
				<h1><?php 
    echo str_replace('WordPress &rsaquo; ', '', $title);
    ?>
</h1>
				<?php 
    echo $message;
    ?>
			</div>
		</div>
		<p class="errorinfo"><a href="./index.php"><?php 
    _e('Homepage', GKTPLNAME);
    ?>
</a></p>
	</div>
</body>
</html>
<?php 
    die;
}