max_num_pages > 1 ) : $gretel_big = 999999999; $listed_page = array( 'base' => str_replace( $gretel_big, '%#%', esc_url( get_pagenum_link( $gretel_big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var( 'paged' ) ), 'prev_text' => '', 'next_text' => '', 'total' => $wp_query->max_num_pages ); echo paginate_links( $listed_page ); endif; } //avatar look modify add_filter( 'get_avatar', 'gretel_avatar_class' ); function gretel_avatar_class( $class ) { if ( is_archive() or is_search() or is_single() or is_page_template( 'blog-page.php' ) ) { $class = str_replace( "class='avatar", "class='" . 'post-auth-img img-circle', $class ) ; } return $class; } //some basic requirements if ( ! isset( $content_width ) ) $content_width = 900; add_theme_support( 'automatic-feed-links' ); //add featured image option add_action( 'after_setup_theme', 'agpl_post_thumb' ); function agpl_post_thumb() { add_theme_support( 'post-thumbnails' ); } //modify the tag cloud add_filter( 'widget_tag_cloud_args', 'agpl_tag_cloud_args' ); function agpl_tag_cloud_args( $args ) { $args['number'] = 20; $args['largest'] = 14; $args['smallest'] = 14; $args['unit'] = 'px'; return $args; } //define new excerpt extention add_filter( 'excerpt_more', 'custom_excerpt_more' ); function custom_excerpt_more( $more ) { global $post; return ' ...
' . __( 'Read more', 'agpl' ) . ''; } //register nav menu register_nav_menus( array( 'agpl_header_menu' => 'Header Main Menu', 'agpl_footer_menu' => 'Footer Main Menu', 'agpl_copy_menu' => 'Footer Copyright Menu' ) ); //page menu fallback function to callback function icon_page_menu( $args ) { extract( $args ); $link = $link_before . '' . $link_after; $output = sprintf( $items_wrap, $menu_id, $menu_class, $link ); if ( ! empty ( $container ) ) { $output = "<$container class='$container_class' id='$container_id'>$output$container>"; } if ( $echo ) { echo $output; } return $output; } //register sidebars add_action( 'widgets_init', 'agpl_sidebar_content' ); function agpl_sidebar_content() { $agpl_sidebar_keys = array( //Sidebars sidebars array( __( 'Feature Horizontal Bar', 'agpl' ), 'feature_hr_bar', __( 'Just after top features area in the front page template. Add \'Feature Box\' Widgets to this 4 column area.', 'agpl' ), ''; echo '
'; echo '' . __( 'No use in "Blog Post Listing" template. Because there is no in-built comment system.', 'agpl' ) . '
'; } //save above metabox data add_action( 'save_post', 'agpl_save_metabox_data' ); function agpl_save_metabox_data( $post_ID ) { $post_ID = $_POST['post_ID']; if ( 'page' == $_POST['post_type'] ) { if ( ! current_user_can( 'edit_page', $post_ID ) ) { return; } if ( isset( $_POST['agpl_page_comment'] ) or wp_verify_nonce( $_POST['agpl_page_comment'], plugin_basename( __FILE__ ) ) ) { $comment_switch_done = $_POST['agpl_page_comment_field']; add_post_meta( $post_ID, '_agpl_page_comment_key', $comment_switch_done, true ) or update_post_meta( $post_ID, '_agpl_page_comment_key', $comment_switch_done ); } } } //styles and javascripts attached to theme add_action( 'wp_head', 'agpl_comment_reply_script_cb' ); function agpl_comment_reply_script_cb() { if ( is_singular() ) wp_enqueue_script( "comment-reply" ); } add_action( 'wp_footer', 'agpl_footer_scripts_cb', 10 ); function agpl_footer_scripts_cb() { wp_enqueue_style( 'agecncy-profile-font-style', 'http://fonts.googleapis.com/css?family=' . agpl_font_name( get_theme_mod( 'head_font_setting' ), get_theme_mod( 'head_font_weight_setting' ) ) . '|' . agpl_font_name( get_theme_mod( 'body_font_setting' ), get_theme_mod( 'body_font_weight_setting' ) ), '', '1.0.', 'all' ); wp_enqueue_style( 'agecncy-profile-base-style', get_template_directory_uri() . '/script/bootstrap.css', '', '3.1.2.', 'all' ); wp_enqueue_style( 'agecncy-profile-extended-style', get_stylesheet_uri(), '', '1.0.', 'all' ); wp_enqueue_script( 'agecncy-profile-base-script', get_template_directory_uri() . '/script/bootstrap.js', array( 'jquery' ), '3.1.2.', TRUE ); wp_enqueue_script( 'agecncy-profile-extended-script', get_template_directory_uri() . '/script/script.js', array( 'jquery' ), '1.0.', TRUE ); } add_action( 'wp_footer', 'agpl_ajax_scripts_cb', 20 ); function agpl_ajax_scripts_cb() { ?>
ID ) ?>