Example #1
0
hoot_attr('post', '', 'archive-big');
?>
>

	<div class="entry-grid grid">

		<?php 
$img_size = apply_filters('hoot_post_image_archive_big', '');
hoot_post_thumbnail('entry-content-featured-img entry-grid-featured-img', $img_size);
?>

		<div class="entry-grid-content grid-span-12">

			<header class="entry-header">
				<?php 
the_title('<h2 ' . hoot_get_attr('entry-title') . '><a href="' . get_permalink() . '" rel="bookmark" itemprop="url">', '</a></h2>');
?>
			</header><!-- .entry-header -->

			<?php 
if (is_sticky()) {
    ?>
				<div class="entry-sticky-tag contrast-typo"><?php 
    _e('Sticky', 'responsive-brix');
    ?>
</div>
			<?php 
}
?>

			<?php 
    function hoot_meta_info_blocks($args = '', $context = '')
    {
        if (!is_array($args)) {
            $args = array_map('trim', explode(',', $args));
        }
        $display = array();
        foreach (array('author', 'date', 'cats', 'tags', 'comments') as $key) {
            if (in_array($key, $args)) {
                $display[$key] = true;
            }
        }
        if (is_page()) {
            if (isset($display['cats'])) {
                unset($display['cats']);
            }
            if (isset($display['tags'])) {
                unset($display['tags']);
            }
        }
        $display = apply_filters('hoot_meta_info_blocks_display', $display, $context);
        if (empty($display)) {
            return;
        }
        ?>

	<div class="entry-byline">

		<?php 
        $blocks = array();
        if (!empty($display['author'])) {
            $blocks['author']['label'] = __('By:', 'responsive-brix');
            ob_start();
            the_author_posts_link();
            $blocks['author']['content'] = '<span ' . hoot_get_attr('entry-author') . '>' . ob_get_clean() . '</span>';
        }
        if (!empty($display['date'])) {
            $blocks['date']['label'] = __('On:', 'responsive-brix');
            $blocks['date']['content'] = '<time ' . hoot_get_attr('entry-published') . '>' . get_the_date() . '</time>';
        }
        if (!empty($display['cats'])) {
            $category_list = get_the_category_list(', ');
            if (!empty($category_list)) {
                $blocks['cats']['label'] = __('In:', 'responsive-brix');
                $blocks['cats']['content'] = $category_list;
            }
        }
        if (!empty($display['tags']) && get_the_tags()) {
            $blocks['tags']['label'] = __('Tagged:', 'responsive-brix');
            $blocks['tags']['content'] = !get_the_tags() ? __('No Tags', 'responsive-brix') : get_the_tag_list('', ', ', '');
        }
        if (!empty($display['comments']) && comments_open()) {
            $blocks['comments']['label'] = __('With:', 'responsive-brix');
            ob_start();
            comments_popup_link(__('0 Comments', 'responsive-brix'), __('1 Comment', 'responsive-brix'), __('% Comments', 'responsive-brix'), 'comments-link', '');
            $blocks['comments']['content'] = ob_get_clean();
        }
        if ($edit_link = get_edit_post_link()) {
            $blocks['editlink']['label'] = '';
            $blocks['editlink']['content'] = '<a href="' . $edit_link . '">' . __('Edit This', 'responsive-brix') . '</a>';
        }
        $blocks = apply_filters('hoot_meta_info_blocks', $blocks, $context);
        foreach ($blocks as $key => $block) {
            if (!empty($block['content'])) {
                echo ' <div class="entry-byline-block entry-byline-' . $key . '">';
                if (!empty($block['label'])) {
                    echo ' <span class="entry-byline-label">' . $block['label'] . '</span> ';
                }
                echo $block['content'];
                echo ' </div>';
            }
        }
        ?>

	</div><!-- .entry-byline -->

	<?php 
    }
/**
 * Outputs an HTML element's attributes.
 *
 * @since 1.0.0
 * @access public
 * @param string  $slug     The slug/ID of the element (e.g., 'sidebar').
 * @param string $context  A specific context (e.g., 'primary').
 * @param string $class    Addisitonal css classes to add.
 * @return void
 */
function hoot_attr($slug, $context = '', $class = '')
{
    echo hoot_get_attr($slug, $context, $class);
}
/**
 * Returns the site description wrapped in an `<h2>` tag.
 *
 * @since 1.0.0
 * @access public
 * @return string
 */
function hoot_get_site_description()
{
    if ($desc = get_bloginfo('description')) {
        $desc = sprintf('<h2 %s>%s</h2>', hoot_get_attr('site-description'), $desc);
    }
    return apply_filters('hoot_site_description', $desc);
}
Example #5
0
        global $post;
        $has_image = $has_icon = false;
        foreach ($content_blocks_query->posts as $post) {
            if (intval($box['page']) == $post->ID) {
                setup_postdata($post);
                if ($image && has_post_thumbnail()) {
                    $has_image = true;
                }
                if (!$image && !empty($box['icon'])) {
                    $has_icon = true;
                }
                if (!empty($excerpt) && empty($box['url'])) {
                    $linktag = '<a href="' . get_permalink() . '" ' . hoot_get_attr('content-block-link', 'permalink') . '>';
                    $linktagend = '</a>';
                } elseif (!empty($box['url'])) {
                    $linktag = '<a href="' . esc_url($box['url']) . ' " ' . hoot_get_attr('content-block-link', 'custom') . '>';
                    $linktagend = '</a>';
                } else {
                    $linktag = $linktagend = '';
                }
                ?>

								<div class="content-block">

									<?php 
                if ($has_image) {
                    ?>
										<div class="content-block-visual content-block-image">
											<?php 
                    echo $linktag;
                    if ($style == 'style4') {
Example #6
0
/**
 * This template tag is meant to replace template tags like `the_category()`, `the_terms()`, etc.  These core 
 * WordPress template tags don't offer proper translation and RTL support without having to write a lot of 
 * messy code within the theme's templates.  This is why theme developers often have to resort to custom 
 * functions to handle this (even the default WordPress themes do this).  Particularly, the core functions 
 * don't allow for theme developers to add the terms as placeholders in the accompanying text (ex: "Posted in %s"). 
 * This funcion is a wrapper for the WordPress `get_the_terms_list()` function.  It uses that to build a 
 * better post terms list.
 *
 * @since 1.0.0
 * @access public
 * @param array   $args
 * @return string
 */
function hoot_get_post_terms($args = array())
{
    $html = '';
    $defaults = array('post_id' => get_the_ID(), 'taxonomy' => 'category', 'text' => '%s', 'before' => '', 'after' => '', 'items_wrap' => '<span %s>%s</span>', 'sep' => _x(', ', 'taxonomy terms separator', 'chromatic'));
    $args = wp_parse_args($args, $defaults);
    $terms = get_the_term_list($args['post_id'], $args['taxonomy'], '', $args['sep'], '');
    if (!empty($terms)) {
        $html .= $args['before'];
        $html .= sprintf($args['items_wrap'], hoot_get_attr('entry-terms', $args['taxonomy']), sprintf($args['text'], $terms));
        $html .= $args['after'];
    }
    return $html;
}
Example #7
0
"<?php 
echo $atts;
?>
><?php 
foreach ($hoot_theme->slider as $slide) {
    if (!empty($slide['image'])) {
        ?>
<li class="lightSlide hootslider-image-slide hootslider-image-slide-<?php 
        echo $slide_count;
        $slide_count++;
        ?>
">

				<?php 
        if (!empty($slide['url']) && empty($slide['button'])) {
            echo '<a href="' . esc_url($slide['url']) . '" ' . hoot_get_attr('hootslider-image-slide-link') . '>';
        }
        ?>
					<img src="<?php 
        echo esc_url($slide['image']);
        ?>
" />
				<?php 
        if (!empty($slide['url']) && empty($slide['button'])) {
            echo '</a>';
        }
        ?>

				<div class="hootslider-image-slide-content">
					<?php 
        if (!empty($slide['caption'])) {
Example #8
0
/**
 * Returns the image logo
 *
 * @since 1.0
 * @access public
 * @return void
 */
function hoot_get_logo_image()
{
    $logo_image = hoot_get_option('logo_image');
    $title = get_bloginfo('name');
    if (!empty($logo_image)) {
        return '<div id="site-logo-img">' . '<h1 ' . hoot_get_attr('site-title') . '>' . '<a href="' . home_url() . '" rel="home">' . '<span class="hide-text forcehide">' . $title . '</span>' . '<img src="' . esc_url($logo_image) . '">' . '</a>' . '</h1>' . '</div>';
    }
}
Example #9
0
/**
 * Display the meta information HTML for single post/page
 *
 * @since 1.0
 * @access public
 * @param array $display information to display
 * @param string $context context in which meta blocks are being displayed
 * @return void
 */
function hoot_meta_info_blocks($display = array(), $context = '')
{
    $default_display = array('author' => true, 'date' => true, 'cats' => true, 'tags' => true, 'comments' => true);
    $display = wp_parse_args($display, $default_display);
    $display = apply_filters('hoot_meta_info_blocks_display', $display, $context);
    if (is_page()) {
        $display['cats'] = $display['tags'] = false;
    }
    $skip = true;
    foreach ($display as $check) {
        $skip = $check ? false : $skip;
    }
    if ($skip) {
        return;
    }
    ?>

	<div class="entry-byline">

		<?php 
    $blocks = array();
    if (!empty($display['author'])) {
        $blocks['author']['label'] = __('By:', 'dispatch');
        ob_start();
        the_author_posts_link();
        $blocks['author']['content'] = '<span ' . hoot_get_attr('entry-author') . '>' . ob_get_clean() . '</span>';
    }
    if (!empty($display['date'])) {
        $blocks['date']['label'] = __('On:', 'dispatch');
        $blocks['date']['content'] = '<time ' . hoot_get_attr('entry-published') . '>' . get_the_date() . '</time>';
    }
    if (!empty($display['cats'])) {
        $category_list = get_the_category_list(', ');
        if (!empty($category_list)) {
            $blocks['cats']['label'] = __('In:', 'dispatch');
            $blocks['cats']['content'] = $category_list;
        }
    }
    if (!empty($display['tags']) && get_the_tags()) {
        $blocks['tags']['label'] = __('Tagged:', 'dispatch');
        $blocks['tags']['content'] = !get_the_tags() ? __('No Tags', 'dispatch') : get_the_tag_list('', ', ', '');
    }
    if (!empty($display['comments']) && comments_open()) {
        $blocks['comments']['label'] = __('With:', 'dispatch');
        ob_start();
        comments_popup_link(__('0 Comments', 'dispatch'), __('1 Comment', 'dispatch'), __('% Comments', 'dispatch'), 'comments-link', '');
        $blocks['comments']['content'] = ob_get_clean();
    }
    if ($edit_link = get_edit_post_link()) {
        $blocks['editlink']['label'] = '';
        $blocks['editlink']['content'] = '<a href="' . $edit_link . '">' . __('Edit This', 'dispatch') . '</a>';
    }
    $blocks = apply_filters('hoot_meta_info_blocks', $blocks, $context);
    foreach ($blocks as $key => $block) {
        if (!empty($block['content'])) {
            echo ' <div class="entry-byline-block entry-byline-' . $key . '">';
            if (!empty($block['label'])) {
                echo ' <span class="entry-byline-label">' . $block['label'] . '</span> ';
            }
            echo $block['content'];
            echo ' </div>';
        }
    }
    ?>

	</div><!-- .entry-byline -->

	<?php 
}