for posts and comments. add_theme_support( 'automatic-feed-links' ); // This theme supports a variety of post formats. add_theme_support( 'post-formats', array( 'aside', 'image', 'link', 'quote', 'status' ) ); if( get_theme_mod( 'agama_header_style', '' ) !== 'transparent' ) { register_nav_menu( 'top', __( 'Top Menu', 'agama' ) ); } register_nav_menu( 'primary', __( 'Primary Menu', 'agama' ) ); /* * 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', ) ); // This theme uses a custom image size for featured images, displayed on "standard" posts. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 800, 9999 ); // Unlimited height, soft crop // Register custom image sizes add_image_size( 'agama-blog-large', 776, 310, true ); add_image_size( 'agama-blog-medium', 320, 202, true ); add_image_size( 'agama-blog-small', 400, 300, true ); add_image_size( 'agama-related-img', 180, 138, true ); add_image_size( 'agama-recent-posts', 700, 441, true ); /* * Declare WooCommerce Support */ add_theme_support( 'woocommerce' ); } add_action( 'after_setup_theme', 'agama_setup' ); /** * Backwards Compatibility for Title Tag * * @since Agama 1.0 */ if ( ! function_exists( '_wp_render_title_tag' ) ) { function agama_slug_render_title() { ?> <?php wp_title( '|', true, 'right' ); ?> '.$title.''; } else { // isolate part 1 and part 2. $title_part_one = strstr($title, ' ', true); // As of PHP 5.3.0 $title_part_two = strstr($title, ' '); $output = '

'.$title_part_one.''.$title_part_two.'

'; } echo $output; } /** * Get Attachment Image Src * * @since Agama v1.0.1 * @return string */ function agama_return_image_src( $thumb_size ) { $att_id = get_post_thumbnail_id(); $att_src = wp_get_attachment_image_src( $att_id, $thumb_size ); return esc_url($att_src[0]); } /** * Check if $page is template page * * @since Agama v1.0.1 * @return string */ function agama_is_page_template( $page ) { if( is_page_template( 'page-templates/'.$page ) ) { return true; } return false; } /** * Filter the page menu arguments. * Makes our wp_nav_menu() fallback -- wp_page_menu() -- show a home link. * * @since Agama 1.0 */ function agama_page_menu_args( $args ) { if ( ! isset( $args['show_home'] ) ) $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'agama_page_menu_args' ); if ( ! function_exists( 'agama_content_nav' ) ) : /** * Displays navigation to next/previous pages when applicable. * * @since Agama 1.0 */ function agama_content_nav( $html_id ) { global $wp_query; if ( $wp_query->max_num_pages > 1 ) : ?> comment_type ) : case 'pingback' : case 'trackback' : // Display trackbacks differently than normal comments. ?>
  • id="comment-">

    ', '' ); ?>

  • id="li-comment-">
    %2$s %3$s', get_permalink(), get_comment_author_link(), // If current post author is also comment author, make it known visually. ( $comment->user_id === $post->post_author ) ? '' . __( 'author', 'agama' ) . '' : '' ); printf( '', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), /* translators: 1: date, 2: time */ sprintf( __( '%1$s at %2$s', 'agama' ), get_comment_date(), get_comment_time() ) ); ?>
    Edit', 'agama' ), '' ); ?> '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    comment_approved ) : ?>

    ' . ( $req ? '*' : '' ) . ''; $fields['email'] = '
    ' . ( $req ? '*' : '' ) . '
    '; $fields['url'] = '
    '; return $fields; } /** * Comment Form Defaults * * @since 1.2.4 */ add_filter( 'comment_form_defaults', 'agama_comment_form_defaults' ); function agama_comment_form_defaults( $defaults ) { global $current_user; $defaults['logged_in_as'] = '
    ' . sprintf( '%s %s. %s', __('Logged in as', 'agama'), admin_url( 'profile.php' ), $current_user->display_name, wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) ), __('Log out of this account', 'agama'), __('Log out?', 'agama') ) . '
    '; $defaults['comment_field'] = '
    '; $defaults['comment_notes_after'] = '
    ' . sprintf( '%s HTML %s: %s', __( 'You may use these', 'agama' ), __( 'tags and attributes', 'agama' ), '' . allowed_tags() . '') . '
    '; $defaults['title_reply'] = sprintf( '%s %s', __( 'Leave a', 'agama' ), __( 'Comment', 'agama' ) ); $defaults['class_submit'] = 'button button-3d button-large button-rounded'; return $defaults; } if ( ! function_exists( 'agama_entry_meta' ) ) : /** * Set up post entry meta. * * Prints HTML with meta information for current post: categories, tags, permalink, author, and date. * * Create your own agama_entry_meta() to override in a child theme. * * @since Agama 1.0 */ function agama_entry_meta() { // Translators: used between list items, there is a space after the comma. $categories_list = get_the_category_list( __( ', ', 'agama' ) ); // Translators: used between list items, there is a space after the comma. $tag_list = get_the_tag_list( '', __( ', ', 'agama' ) ); $date = sprintf( '', esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date('c') ), esc_html( get_the_date() ) ); $author = sprintf( '', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'agama' ), get_the_author() ) ), get_the_author() ); // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name. if ( $tag_list ) { $utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s by %4$s.', 'agama' ); } elseif ( $categories_list ) { $utility_text = __( 'This entry was posted in %1$s on %3$s by %4$s.', 'agama' ); } else { $utility_text = __( 'This entry was posted on %3$s by %4$s.', 'agama' ); } printf( $utility_text, $categories_list, $tag_list, $date, $author ); } endif; /** * .article-wrapper Grid, List - Style * * @since Agama v1.0.1 */ function agama_article_wrapper_class() { $blog_layout = get_theme_mod('agama_blog_layout', 'list'); switch( $blog_layout ): case 'list': echo 'list-style'; break; case 'grid': echo 'grid-style'; break; case 'small_thumbs': echo 'small_thumbs'; break; endswitch; } /** * Render HTML for blog post date / post format * * @since Agama v1.0.1 */ if( ! function_exists( 'agama_render_blog_post_date' ) ) { function agama_render_blog_post_date() { global $post; // If not single post if( !is_single() ) { echo '
    '; echo '
    '; echo sprintf( '%s', get_the_time('d') ); // Get day echo sprintf( '%s', get_the_time('m, Y') ); // Get month, year echo '
    '; echo '
    '; echo sprintf( '%s', Agama::post_format() ); echo '
    '; echo '
    '; } } } add_action( 'agama_blog_post_date_and_format', 'agama_render_blog_post_date', 10 ); /** * Render HTML blog post meta details * * @since Agama v1.0.1 */ if( ! function_exists( 'agama_render_blog_post_meta' ) ) { function agama_render_blog_post_meta() { if( get_theme_mod( 'agama_blog_post_author', true ) ) { echo sprintf( '%s %s', '', get_the_author_link() ); echo sprintf( '%s', '/' ); } echo sprintf( '%s %s', '', get_the_time('F j, Y') ); // Output next details only on list blog layout or on single post page if( get_theme_mod('agama_blog_layout', 'list') == 'list' || is_single() ) { echo '/'; echo sprintf( '%s %s', '', get_the_category_list(', ') ); echo '/'; // Comments number if( comments_open() ) { echo sprintf( '%s %s', '', get_comments_link(), get_comments_number().__( ' comments', 'agama' ) ); } } } } add_action( 'agama_blog_post_meta', 'agama_render_blog_post_meta', 10 ); /** * Infinite Scroll Init * * @since 1.0.3 */ function agama_infinite_scroll_init() { ?> Theme-Vision' ) ) ); } } add_action( 'agama_credits', 'agama_render_credits' );