This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// don't allow users to access WordPress admin | |
add_action('admin_init', 'endo_hide_dashboard'); | |
function endo_hide_dashboard() { | |
if ( ! current_user_can( 'manage_options' ) && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { | |
wp_redirect(home_url()); exit; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function pagination($prev = '«', $next = '»') { | |
global $wp_query, $wp_rewrite; | |
$wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; | |
$pagination = array( | |
'base' => @add_query_arg('paged','%#%'), | |
'format' => '', | |
'total' => $wp_query->max_num_pages, | |
'current' => $current, | |
'prev_text' => __($prev), |