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, ); add_theme_support( 'custom-header', $args ); // This theme uses a custom image size for featured images, displayed on "standard" posts. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 450, 600 ); } 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 Left', 'alpona' ), 'id' => 'sidebar-1', 'description' => __( 'Appears on first sidebar on left where widgets are shown.', 'alpona' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'alpona_widgets_init' ); /** * ------------------------------------- * Step 6.0 - Filter Image to responsive * ------------------------------------- * * @since alpona 1.0 */ function add_image_responsive_class($content) { global $post; $pattern ="//i"; $replacement = ''; $content = preg_replace($pattern, $replacement, $content); return $content; } add_filter('the_content', 'add_image_responsive_class'); /** * -------------------------------- * Step 7.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-">
    %1$s %2$s', get_comment_author_link(), // If current post author is also comment author, make it known visually. ( $comment->user_id === $post->post_author ) ? '' . __( 'Post author', 'alpona' ) . '' : '' ); printf( '', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), /* translators: 1: date, 2: time */ sprintf( __( '%1$s at %2$s', 'alpona' ), get_comment_date(), get_comment_time() ) ); ?>
    comment_approved ) : ?>

    ', '

    ' ); ?>
    __( 'Reply', 'alpona' ), 'after' => ' ', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    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'
      '; if ( $paged > $p + 2 ) echo '... '; for( $i = $paged - $p; $i <= $paged + $p; $i++ ) { // Middle pages if ( $i > 0 && $i <= $max_page ) $i == $paged ? print "
    • {$i}
    • " : p_link( $i ); } if ( $paged < $max_page - $p - 1 ) echo '... '; if ( $paged < $max_page - $p ) p_link( $max_page, 'Last' ); echo'
    '; } function p_link( $i, $title = '' ) { if ( $title == '' ) $title = "Page {$i}"; echo "
  • {$i}
  • "; } /** * ------------------------- * Step 9.0 - Add read more * ------------------------- */ function arb_excerpt_more( $more ) { return ' ' . __('Continue Reading', 'your-text-domain') . ''; } add_filter( 'excerpt_more', 'arb_excerpt_more' ); /** * ----------------------------------- * Step 10.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 11.0 - Required files * -------------------------- */ get_template_part('inc/customizer'); ?>