/** * Determine if a post should display in a single column or not. * * @since 1.1.3. * * @param int $post_id The post ID. * @return bool True if post should display in single column. */ function oxford_is_single_column($post_id) { $post_id = absint($post_id); $is = false; $char_count = oxford_get_post_char_count($post_id); $threshold = oxford_get_post_char_threshold(); if (0 !== $post_id && ($char_count < $threshold && (is_single() || is_page() && 'two-column-page.php' === get_page_template_slug()) || is_single() && true === oxford_get_post_meta('settings', $post_id, 'post-single-column'))) { $is = true; } return apply_filters('oxford_is_single_column', $is, $post_id); }
$image_ids = oxford_get_featured_image_ids(get_the_ID()); $too_small = array_keys($image_ids, 0); if (count($image_ids) > count($too_small)) { $post_class = 'has-featured-image'; } ?> <article id="post-<?php the_ID(); ?> " <?php post_class($post_class); ?> > <div class="entry-content<?php if (oxford_get_post_char_count() >= oxford_get_post_char_threshold() && !oxford_get_post_meta('settings', get_the_ID(), 'post-single-column')) { echo ' content-columns'; } ?> "> <header class="entry-header"> <?php get_template_part('_post', 'title'); ?> <p class="entry-author-byline"> <?php printf(_x('by %s', 'author byline', 'oxford'), sprintf('<a class="vcard" href="%1$s">%2$s</a>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_html(get_the_author_meta('display_name')))); ?> </p> </header>
<?php /** * @package oxford */ // Should there be columns? $extra_class = ''; if (is_page_template('two-column-page.php') && oxford_get_post_char_count() >= oxford_get_post_char_threshold()) { $extra_class = ' content-columns'; } ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <div class="entry-content<?php echo esc_attr($extra_class); ?> "> <?php // Only show title if theme option is set. if (get_theme_mod('show-page-title')) { ?> <header class="entry-header"> <?php get_template_part('_post', 'title'); ?>