' . __( 'Sticky', THEMEORA_THEME_NAME ) . ''; if ( ! has_post_format( 'link' ) && 'post' == get_post_type() ) { echo '
'; echo __('Posted on', THEMEORA_THEME_NAME) . ' '; echo get_the_time('jS') . ' ' . get_the_time('F') . ', ' . __('by', THEMEORA_THEME_NAME) . ' ' ; the_author_posts_link(); if ( !$shorten ) { echo ' ' . __('in', THEMEORA_THEME_NAME) . ' '; the_category(', ') . ' ' ; } echo '
'; } } /** * Prints HTML with date information for current post. * @since themeora 1.0 * @param boolean $echo Whether to echo the date. Default true. * @return string The HTML-formatted post date. */ function themeora_entry_date( $echo = true ) { if ( has_post_format( array( 'chat', 'status' ) ) ) $format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', THEMEORA_THEME_NAME ); else $format_prefix = '%2$s'; $date = sprintf( '', esc_url( get_permalink() ), esc_attr( sprintf( __( 'Permalink to %s', THEMEORA_THEME_NAME ), the_title_attribute( 'echo=0' ) ) ), esc_attr( get_the_date( 'c' ) ), esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) ) ); if ( $echo ) echo $date; return $date; } /** * Displays navigation to next/previous post when applicable. * @since themeora 1.0 * @return next and prev posts links */ function themeora_post_nav() { global $post; global $themeora_options; if( get_theme_mod( 'post_pagination' ) == true ) { // Don't print empty markup if there's nowhere to navigate. $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; ?> '; echo the_tags( '

' . __('Tagged As', THEMEORA_THEME_NAME) . '

', '', '' ); echo ''; } } /** * Displays author information under posts * @since themeora 1.0 * @return block of html to display author info */ function themeora_post_author_meta() { global $themeora_options; if( get_theme_mod( 'show_author_bio' ) == true ) { if ( 'post' == get_post_type() && get_the_author_meta('first_name') != '' && get_the_author_meta('last_name') != '') { ?>

:

.
max_num_pages < 2 ) return; ?>
the_meta(); $embed_url = isset($meta['media-url']) ? $meta['media-url'] : ''; $has_gallery = false; if ( isset($meta['gallery']) ) { $has_gallery = true; } //check for a featured image if ( has_post_thumbnail( $postId ) && get_post_format($postId) != "gallery" ) : ?> '. __('...read more', THEMEORA_THEME_NAME) . ''; } add_filter( 'excerpt_more', 'themeora_excerpt_more' ); /** * Default loop * * Run a loop based off the provided page id. If no id is passed in, just do a standard loop. * Used to return various pages for the single page template. * @param int $page. The id of the page * @param boolean $sidebar. Should the sidebar be shown * @return the page structure for full width or default page */ function themeora_default_page_loop( $page = null, $sidebar = null ) { $col_span = $sidebar === true ? 'col-md-8' : 'col-md-12'; $template = get_page_template_slug( $page ); ?>

$value ) { if ( is_array( $value ) ) { foreach ( $value as $image => $attr ) { if ( is_array( $attr ) ) themeora_retina_support_create_images( get_attached_file( $attachment_id ), $attr['width'], $attr['height'], true ); } } } return $metadata; } add_filter( 'wp_generate_attachment_metadata', 'themeora_retina_support_attachment_meta', 10, 2 ); /** * Create retina-ready images * Referenced via retina_support_attachment_meta(). */ function themeora_retina_support_create_images( $file, $width, $height, $crop = false ) { if ( $width || $height ) { $resized_file = wp_get_image_editor( $file ); if ( ! is_wp_error( $resized_file ) ) { $filename = $resized_file->generate_filename( $width . 'x' . $height . '@2x' ); $resized_file->resize( $width * 2, $height * 2, $crop ); $resized_file->save( $filename ); $info = $resized_file->get_size(); return array( 'file' => wp_basename( $filename ), 'width' => $info['width'], 'height' => $info['height'], ); } } return false; } /** * Delete retina-ready images * This function is attached to the 'delete_attachment' filter hook. */ function themeora_delete_retina_support_images( $attachment_id ) { $meta = wp_get_attachment_metadata( $attachment_id ); if ( $meta ){ $upload_dir = wp_upload_dir(); $path = pathinfo( $meta['file'] ); foreach ( $meta as $key => $value ) { if ( 'sizes' === $key ) { foreach ( $value as $sizes => $size ) { $original_filename = $upload_dir['basedir'] . '/' . $path['dirname'] . '/' . $size['file']; $retina_filename = substr_replace( $original_filename, '@2x.', strrpos( $original_filename, '.' ), strlen( '.' ) ); if ( file_exists( $retina_filename ) ) unlink( $retina_filename ); } } } } } add_filter( 'delete_attachment', 'themeora_delete_retina_support_images' );