post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; } // Don't print empty markup in archives if there's only one page. if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) return; $nav_class = ( is_single() ) ? 'navigation-post' : 'navigation-paging'; ?> comment_type || 'trackback' == $comment->comment_type ) : ?>
  • >
    ', '' ); ?>
  • >
    says:', 'apptheme-free' ), sprintf( '%s', get_comment_author_link() ) ); ?>
    comment_approved ) : ?>

    'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); // If there is more than 1 attachment in a gallery... if ( count( $attachments ) > 1 ) { foreach ( $attachments as $k => $attachment ) { if ( $attachment->ID == $post->ID ) break; } $k++; // get the URL of the next image attachment... if ( isset( $attachments[ $k ] ) ) $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); // or get the URL of the first image attachment. else $next_attachment_url = get_attachment_link( $attachments[0]->ID ); } printf( '%3$s', esc_url( $next_attachment_url ), the_title_attribute( array( 'echo' => false ) ), wp_get_attachment_image( $post->ID, $attachment_size ) ); } /** * Prints HTML with meta information for the current post-date/time and author. * @since 0.0.1 */ public static function posted_on() { printf( __( 'Posted on by ', 'apptheme-free' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'apptheme-free' ), get_the_author() ) ), get_the_author() ); } /** * Returns true if a blog has more than 1 category * @since 0.0.1 */ public static function categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) { // Create an array of all the categories that are attached to posts $all_the_cool_cats = get_categories( array( 'hide_empty' => 1, ) ); // Count the number of categories that are attached to the posts $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'all_the_cool_cats', $all_the_cool_cats, HOUR_IN_SECONDS ); } if ( '1' != $all_the_cool_cats ) { // This blog has more than 1 category so return true return true; } else { // This blog has only 1 category so return false return false; } } /** * Checks if logo has been added via the customizer * @since 0.0.1 */ public static function has_logo() { if ( self::$has_logo !== 'no' ) return self::$has_logo; self::$has_logo = get_theme_mod( 'appp_logo' ); return self::$has_logo; } /** * Gets page header area * @since 0.0.1 */ public static function title_header() { $object = get_queried_object(); $description = isset( $object->taxonomy ) ? term_description( $object->term_id, $object->taxonomy ) : false; if ( ! self::has_logo() && ! $description ) return; if ( is_home() || is_front_page() ) return; ?>
    %s', self::get_title( false ) ); } if ( $description ) { $tax = $object->taxonomy == 'post_tag' ? 'tag' : $object->taxonomy; // add a filter and show our taxonomy term description echo apply_filters( "{$tax}_archive_meta", sprintf( '
    %s
    ', $description ) ); } ?>
    ' . single_cat_title( '', false ) . '' ); elseif ( is_tag() ) : self::$title = sprintf( __( '%s', 'apptheme-free' ), '' . single_tag_title( '', false ) . '' ); elseif ( isset( $object->taxonomy ) ) : self::$title = sprintf( __( '%s', 'apptheme-free' ), '' . single_term_title( '', false ) . '' ); elseif ( is_author() ) : /* Queue the first post, that way we know * what author we're dealing with (if that is the case). */ the_post(); self::$title = sprintf( __( '%s', 'apptheme-free' ), '' . get_the_author() . '' ); /* Since we called the_post() above, we need to * rewind the loop back to the beginning that way * we can run the loop properly, in full. */ rewind_posts(); elseif ( is_day() ) : self::$title = sprintf( __( '%s', 'apptheme-free' ), '' . get_the_date() . '' ); elseif ( is_month() ) : self::$title = sprintf( __( '%s', 'apptheme-free' ), '' . get_the_date( 'F Y' ) . '' ); elseif ( is_year() ) : self::$title = sprintf( __( '%s', 'apptheme-free' ), '' . get_the_date( 'Y' ) . '' ); elseif ( is_404() ) : self::$title = __( 'Missing', 'apptheme-free' ); elseif ( is_search() ) : self::$title = sprintf( __( 'Search: %s', 'apptheme-free' ), '' . get_search_query() . '' ); elseif ( is_singular() || is_page() ) : self::$title = single_post_title( '', false ); else : self::$title = get_bloginfo( 'name' ); endif; if ( $echo ) echo self::$title; return self::$title; } /** * Flush out the transients used in categorized_blog * @since 0.0.1 */ public function flush_cats() { // Like, beat it. Dig? delete_transient( 'all_the_cool_cats' ); } /** * Utility method that attempts to get an attachment's ID by it's url * @since 0.0.1 * @param string $img_url Attachment url * @return mixed Attachment ID or false */ public static function image_id_from_url( $img_url ) { global $wpdb; // Get just the file name if ( strpos( $img_url, '/' ) ) { $_img_url = explode( '/', $img_url ); $img_url = end( $_img_url ); } // And search for a fuzzy match of the file name $attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid LIKE '%%%s%%' LIMIT 1;", $img_url ) ); // If we found an attachement ID, return it if ( !empty( $attachment ) && is_array( $attachment ) ) return $attachment[0]; // No luck return false; } } function appp_content_nav( $nav_id ) { return AppPresser_Tags::content_nav( $nav_id ); } function appp_comment( $comment, $args, $depth ) { return AppPresser_Tags::comment( $comment, $args, $depth ); } function appp_the_attached_image() { return AppPresser_Tags::attached_image(); } function appp_posted_on() { return AppPresser_Tags::posted_on(); } function appp_categorized_blog() { return AppPresser_Tags::categorized_blog(); } function appp_has_logo() { return AppPresser_Tags::has_logo(); } function appp_get_title( $echo = true ) { return AppPresser_Tags::get_title( $echo ); } function appp_title_header() { return AppPresser_Tags::title_header(); }