'',
'random-default' => false,
'width' => 1175,
'height' => 400,
'flex-width' => true,
'flex-height' => true,
'default-text-color' => '333',
'header-text' => true,
'uploads' => true,
);
add_theme_support( 'custom-header', $gimliii_header_args );
add_theme_support( "custom-background");
add_editor_style();
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'gimliii' )
) );
add_theme_support( 'html5', array(
'search-form', 'comment-form'
) );
}
add_action( 'after_setup_theme', 'gimliii_setup' );
get_template_part('inc/widgets');
//require_once(get_template_directory() .'/admin/theme-settings.php');
/* Widgetize Theme */
function gimliii_widgets_init() {
register_sidebar(array(
'name' => ' Right Sidebar',
'id' => 'gimliii-right-sidebar',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => ' ',
));
register_sidebar(array(
'name' => 'Footer One',
'id' => 'gimliii-footer-one',
'before_widget' => '',
'before_title' => '
',
'after_title' => ' ',
));
register_sidebar(array(
'name' => 'Footer Two',
'id' => 'gimliii-footer-two',
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => ' ',
));
register_sidebar(array(
'name' => 'Footer Three',
'id' => 'gimliii-footer-three',
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => ' ',
));
}
add_action( 'widgets_init', 'gimliii_widgets_init' );
function gimliii_filter_wp_title( $title, $separator ) {
if ( is_feed() )
return $title;
global $paged, $page;
if ( is_search() ) {
$title = sprintf( 'Search results for %s', '"' . get_search_query() . '"' );
if ( $paged >= 2 )
$title .= " $separator " . sprintf( 'Page %s', $paged );
$title .= " $separator " . get_bloginfo( 'name', 'display' );
return $title;
}
$title .= get_bloginfo( 'name', 'display' );
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title .= " $separator " . $site_description;
if ( $paged >= 2 || $page >= 2 )
$title .= " $separator " . sprintf( 'Page %s', max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'gimliii_filter_wp_title', 10, 2 );
if(!is_admin()){
function gimliii_styles(){
wp_enqueue_style( 'bootcss', get_template_directory_uri().'/js/bootstrap/css/bootstrap.min.css', array() );
wp_enqueue_style( 'gimliii-style', get_stylesheet_uri(), array( 'bootcss' ) );
wp_enqueue_style( 'fontawesome', get_template_directory_uri().'/vendor/font-awesome/css/font-awesome.css', array() );
}
add_action( 'wp_enqueue_scripts', 'gimliii_styles' );
function gimliii_scripts(){
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'jm', get_template_directory_uri() . '/vendor/jquery-migrate.js', array('jquery'), '110', true );
wp_enqueue_script( 'bootjs', get_template_directory_uri() . '/js/bootstrap/js/bootstrap.min.js', array('jquery'), '110', true );
wp_enqueue_script( 'cu', get_template_directory_uri() . '/vendor/superfish.js', array('jquery'), '110', true );
wp_enqueue_script( 'gimlijs', get_template_directory_uri() . '/js/gimli.js', array('jquery'), '110', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'gimliii_scripts' );
}
if ( ! function_exists( 'gimliii_posted_on' ) ) :
function gimliii_posted_on() {
if(!is_single()){
printf( '%3$s ',
esc_url( get_permalink() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
}
else {
printf( '%3$s ',
esc_url( get_permalink() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
}
}
endif;
if ( ! function_exists( 'gimliii_paging_nav' ) ) :
function gimliii_paging_nav() {
if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
return;
}
$paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1;
$pagenum_link = html_entity_decode( get_pagenum_link() );
$query_args = array();
$url_parts = explode( '?', $pagenum_link );
if ( isset( $url_parts[1] ) ) {
wp_parse_str( $url_parts[1], $query_args );
}
$pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link );
$pagenum_link = trailingslashit( $pagenum_link ) . '%_%';
$format = $GLOBALS['wp_rewrite']->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : '';
$format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%';
// Set up paginated links.
$links = paginate_links( array(
'base' => $pagenum_link,
'format' => $format,
'total' => $GLOBALS['wp_query']->max_num_pages,
'current' => $paged,
'mid_size' => 1,
'add_args' => array_map( 'urlencode', $query_args ),
'prev_text' => __( '← Prev', 'gimliii' ),
'next_text' => __( 'Next →', 'gimliii' ),
) );
if ( $links ) :
?>
post_parent ) : get_adjacent_post( false, '', true );
$next = get_adjacent_post( false, '', false );
if ( ! $next && ! $previous ) {
return;
}
?>
Published In%title', 'gimliii' ) );
else :
previous_post_link( '%link', __( ' Prev Post ', 'gimliii' ) );
next_post_link( '%link', __( 'Next Post ', 'gimliii' ) );
endif;
?>
id="comment-">
';}endif; ?>
posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY comment_count DESC LIMIT 0,".$pop_posts;
$posts = $wpdb->get_results($popularposts);
if($posts){
global $post;
foreach($posts as $post){
setup_postdata($post);?>
';}endif; ?>
';}endif; ?>