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"; } 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' ), '
', '
', '

', '

' ), array( __( 'Service Horizontal Bar', 'agpl' ), 'service_hr_bar', __( '3 column area, after top features area in the front page. Also it in Service template. Add upto 9 responsive \'Service Box\' Widgets here. And then connect each of them to service images, uploaded through \'Upload Images\' section in Live Editor.', 'agpl' ), '
', '
', '', '' ), array( __( 'About Area Sidebar', 'agpl' ), 'about_sidebar', __( 'At the right hand side of about area in the front page and in About template. Add upto 4 \'About Point Box\' Widgets here and connect them with corrosponding uploaded images. Just like Service Section.', 'agpl' ), '
', '
', '', '' ), array( __( 'Set of Team Members Bar', 'agpl' ), 'team_set_bar', __( '3 column area at the bottom of about area in front page and in About template. Add upto 10 \'Team Member Widget\' here and connect each of them with team member images. Just like Service Section.', 'agpl' ), '', '', '', '' ), array( __( 'Skill Set Bar', 'agpl' ), 'skill_set_bar', __( 'Placed after about area only in the front page. 3 column area, add \'Skill Box\' widgets here.', 'agpl' ), '
', '
', '', '' ), array( __( 'Portfolio Project Bar', 'agpl' ), 'portfolio_set_bar', __( '4 column area, after Skill Set area of the front page. Add upto maximum 12 \'Project Description widget\' here and connect each of them with portfolio images, previously uploaded.', 'agpl' ), '', '', '', '' ), array( __( 'Testimonial Bar', 'agpl' ), 'testimonial_bar', __( 'Add upto 2 customer comments, using \'Testimonial Box widget\' in this single column area. Connect each of them with corrosponding testimonial images. Just like Service Section.', 'agpl' ), '
', '
', '', '' ), array( __( 'Social Media Bar', 'agpl' ), 'social_media_sidebar', __( 'At top of the footer of every webpage. Use \'Social Media Icon\' widgets here. Maximum 12 are alolwed, due to design constrains.', 'agpl' ), '', '', '', '' ), //General sidebars array( __( 'Footer Horizontal Bar', 'agpl' ), 'footer_sidebar', __( 'At bottom of footer of every webpage with 3 columns for widgets.', 'agpl' ), '
', '
', '

', '

' ), array( __( 'Blog Footer Bar', 'agpl' ), 'blog_footer_sidebar', __( '3 column area at bottom of blog archives. Great place to show comments, calenders, rss feed etc.', 'agpl' ), '
', '
', '

', '

' ), array( __( 'Single Post Footer Bar', 'agpl' ), 'single_footer_sidebar', __( '3 column area at footer of single post. Just at the top of post navigation. Great place to show archives, tags, categories, ads etc.', 'agpl' ), '
', '
', '

', '

' ), array( __( 'single Post Sidebar', 'agpl' ), 'single_post_sidebar', __( 'At side of single post template. Set it on left or right side as you wish in customizer. Show ads, social widgets, email forms etc.', 'agpl' ), '
', '
', '

', '

' ), array( __( 'Page Footer Bar', 'agpl' ), 'page_footer_sidebar', __( '3 column area at footer of pages. Use whatever you like', 'agpl' ), '
', '
', '

', '

' ), array( __( 'Page Sidebar', 'agpl' ), 'single_page_sidebar', __( 'At left side of default page template.', 'agpl' ), '
', '
', '

', '

' ), array( __( 'Page Right Sidebar', 'agpl' ), 'single_page_sidebar_right', __( 'At right side of the Right Sidebar Page Template.', 'agpl' ), '
', '
', '

', '

' ), ); foreach ( $agpl_sidebar_keys as $key ) { register_sidebar( array( 'name' => $key[0], 'id' => $key[1], 'description' => $key[2], 'before_widget' => $key[3], 'after_widget' => $key[4], 'before_title' => $key[5], 'after_title' => $key[6], )); } } /*Comments template callback for comment list*/ function agpl_comment_cb( $comment, $args, $depth ) { ?>
  • id="li-comment-">

    comment_approved == '0' ) : ?> Your comment is awaiting moderation.
    ID ) ?>
    __( 'REPLY', 'agpl' ), 'add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>   

    ID ); $comment_switch = $comment_meta['_agpl_page_comment_key']; echo '

    '; 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() { ?>