* * @package Rock * @since 1.0.0 */ ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php if (!rock_use_featured_hero_image()) { ?> <?php get_template_part('templates/parts/loop/post', 'thumbnail'); ?> <?php } ?> <?php get_template_part('templates/parts/loop/page', 'content'); ?> <?php
?> > <?php /** * Fires inside the `article` element, before the content. * * @hooked rock_woo_shop_messages - 10 * * @since 1.0.0 */ do_action('rock_before_post_content'); ?> <?php if (!is_single() || !rock_use_featured_hero_image()) { ?> <?php get_template_part('templates/parts/loop/post', 'thumbnail'); ?> <?php } ?> <?php get_template_part('templates/parts/loop/post', 'title'); ?> <?php
/** * Return the hero image URL. * * @since 1.0.0 * * @return string|null */ function rock_get_hero_image() { /** * Filter the hero image size. * * @since 1.0.0 * * @var string */ $size = (string) apply_filters('rock_hero_image_size', 'rock-hero'); /** * Featured Image (if enabled) */ if (rock_use_featured_hero_image() && ($post = get_queried_object()) && has_post_thumbnail($post)) { $image = wp_get_attachment_image_src(get_post_thumbnail_id($post), $size); if (isset($image[0])) { return $image[0]; } } /** * Header Image */ if (has_header_image()) { $header = get_custom_header(); if (!empty($header->attachment_id)) { $image = wp_get_attachment_image_src($header->attachment_id, $size); if (isset($image[0])) { return $image[0]; } } return get_header_image(); } }