in
add_theme_support( 'title-tag' );
// add RSS feed links in
add_theme_support( 'automatic-feed-links' );
// featured image support
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 1000, 1000 );
// enable html5 features
add_theme_support( 'html5', array(
'comment-list',
'comment-form',
'gallery',
'caption',
) );
// custom background image support
add_theme_support( 'custom-background' , array(
'default-image' => get_template_directory_uri() . '/images/arix-background.jpg',
'default-repeat' => 'no-repeat',
'default-position-x' => 'center',
'default-position-y' => 'center',
'default-attachment' => 'fixed',
) );
// custom logo support
add_theme_support( 'custom-logo', array(
'height' => 360,
'width' => 460,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title', 'site-description' ),
) );
// navigation menu
register_nav_menus( array(
'main_menu' => __( 'Main Menu', 'arix' )
) );
// visual editor styles and fonts
add_editor_style( array( 'editor-style.css', arix_google_fonts() ) );
}
add_action( 'after_setup_theme', 'arix_functions' );
// widget areas
function arix_widgets() {
register_sidebar( array(
'name' => __( 'Sidebar 1', 'arix' ),
'id' => 'sidebar',
'before_widget' => '',
'after_widget' => "
\n",
'before_title' => '\n",
) );
register_sidebar( array(
'name' => __( 'Footer', 'arix' ),
'id' => 'footer',
'before_widget' => '',
'after_widget' => "
\n",
'before_title' => '\n",
) );
}
add_action( 'widgets_init', 'arix_widgets' );
// set content width
function arix_content_width() {
$GLOBALS['content_width'] = apply_filters( 'arix_content_width', 1000 );
}
add_action( 'after_setup_theme', 'arix_content_width', 0 );
// numeric page nav
function arix_page_nav() {
global $wp_query;
$bignum = 999999999;
if ( $wp_query->max_num_pages <= 1 )
return;
echo '';
}
// register google fonts
if ( ! function_exists( 'arix_google_fonts' ) ) :
function arix_google_fonts() {
$fonts_url = '';
$fonts = array();
$subsets = 'latin,latin-ext';
/* translators: If there are characters in your language that are not supported by Dosis, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'Dosis font: on or off', 'arix' ) ) {
$fonts[] = 'Dosis:300,500';
}
if ( $fonts ) {
$fonts_url = add_query_arg( array(
'family' => urlencode( implode( '|', $fonts ) ),
'subset' => urlencode( $subsets ),
), 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
}
endif;
// recent comments
function arix_recent_comments( $no_comments = 3, $comment_len = 130 ) {
$comments_query = new WP_Comment_Query();
$comments = $comments_query->query( array( 'number' => $no_comments ) );
$comm = '';
if ( $comments ) : foreach ( $comments as $comment ) :
$comm .= '';
$comm .= get_comment_author( $comment->comment_ID ) . ': ';
$comm .= '' . strip_tags( substr( apply_filters( 'get_comment_text', $comment->comment_content ), 0, $comment_len ) ) . '...
';
endforeach; else :
$comm .= 'No comments.';
endif;
echo $comm;
}
?>