for posts and comments.
add_theme_support( 'automatic-feed-links' );
// This theme uses wp_nav_menu() in one location.
register_nav_menu( 'top-menu', __( 'Top Menu', 'alpona' ) );
// Add theme support for title tag
add_theme_support( 'title-tag' );
/*
* This theme supports custom background color and image,
* and here we also set up the default background color.
*/
add_theme_support( 'custom-background', array(
'default-color' => '#e6e6e6',
'header-text' => true,
'default-text-color' => '444',
) );
/* Add theme support for custom-header */
$args = array(
'width' => 1200,
'height' => 250,
'uploads' => true,
'default-text-color' => '444444',
);
add_theme_support( 'custom-header', $args );
// Adding post thumbnail
add_theme_support( 'post-thumbnails' );
}
add_action( 'after_setup_theme', 'alpona_setup_theme' );
/**
* ----------------------
* Step 4.0 - Filter Menu
* ----------------------
*
* Filter the page menu arguments.
*
* Makes our wp_nav_menu() to fallback - wp_page_menu() - show a home link.
*
* @since alpona 1.0
*/
function alpona_page_menu_args( $args ) {
if ( ! isset( $args['show_home'] ) )
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'alpona_page_menu_args' );
/**
* --------------------------
* Step 5.0 - Filter WP title
* --------------------------
*
* Register sidebars.
*
* Registers our widgets area.
*
* @since alpona 1.0
*/
function alpona_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Sidebar right', 'alpona' ),
'id' => 'sidebar-1',
'description' => __( 'Appears on first sidebar on right where widgets are shown.', 'alpona' ),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
) );
}
add_action( 'widgets_init', 'alpona_widgets_init' );
/**
* --------------------------------
* Step 6.0 - Custom comment form
* --------------------------------
*/
if ( ! function_exists( 'alpona_comment' ) ) :
/**
* Template for comments and pingbacks.
*
* To override this walker in a child theme without modifying the comments template
* simply create your own alpona_comment(), and that function will be used instead.
*
* Used as a callback by wp_list_comments() for displaying the comments.
*
* @since alpona 1.0
*/
function alpona_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
// Display trackbacks differently than normal comments.
?>
id="comment-">
', '' ); ?>
id="li-comment-">
max_num_pages;
if ( $max_page == 1 ) return; // don't show when only one page
if ( empty( $paged ) ) $paged = 1;
// echo 'Page: ' . $paged . ' of ' . $max_page . ' '; // pages
if ( $paged > $p + 1 ) p_link( 1, 'First' );
echo'';
}
function p_link( $i, $title = '' ) {
if ( $title == '' ) $title = "Page {$i}";
echo "{$i}";
}
/**
* -------------------------
* Step 8.0 - Add read more
* -------------------------
*/
function arb_excerpt_more( $more ) {
return ' ' . __('Continue Reading', 'your-text-domain') . '';
}
add_filter( 'excerpt_more', 'arb_excerpt_more' );
/**
* -----------------------------------
* Step 9.0 - Customizer live preview
* -----------------------------------
* Used by hook: 'customize_preview_init'
*
* @see add_action('customize_preview_init',$func)
*/
function arbblogging_customizer_live_preview()
{
wp_enqueue_script(
'arb-themecustomizer', //Give the script an ID
get_template_directory_uri().'/js/theme-customizer.js',//Point to file
array( 'jquery','customize-preview' ), //Define dependencies
'4.1', //Define a version (optional)
true //Put script in footer?
);
}
add_action( 'customize_preview_init', 'arbblogging_customizer_live_preview' );
/**
* --------------------------
* Step 10.0 - Required files
* --------------------------
*/
require get_template_directory() . '/inc/customizer.php';
?>