Beispiel #1
0
function get_headlines()
{
    $output = '';
    $output .= <<<HTML
    <section class="headline-banner">
      <div class="slider headline-slider">
        
HTML;
    $args = array('numberposts' => -1, 'post_type' => 'headline');
    $headline_posts = get_posts($args);
    if (!$headline_posts) {
        return false;
    }
    //bg divs
    $i = 0;
    foreach ($headline_posts as $post) {
        $thumb_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'headline-thumb')[0];
        $duo_url = \Firebelly\Media\get_duo_url($post, ['size' => 'headline-thumb']);
        $output .= <<<HTML
    <div class="slide-item slide-bg" style="background-image: url('{$thumb_url}')" data-slick-index="{$i}" >
      <div class="headline-duo" style="background-image: url('{$duo_url}')"> </div>
    </div>
HTML;
        $i++;
    }
    //add the goddamn dots :)
    $output .= '<div class="bg-dots"></div>';
    $output .= '<div class="overflow-wrapper">';
    //article divs
    $i = 0;
    foreach ($headline_posts as $post) {
        $link_text = get_post_meta($post->ID, '_cmb2_link_text', true);
        $links_to = get_permalink(get_post_meta($post->ID, '_cmb2_links_to', true));
        $output .= <<<HTML
      <article class="slide-fg headline-article" data-slick-index="{$i}" data-links-to="{$links_to}">
        <h1 class="headline-title"><span class="gradient-highlight">{$post->post_title}</span></h1>
        <a class="learn-more">{$link_text}</a>
      </article>
HTML;
        $i++;
    }
    $output .= <<<HTML
        </div>
      </div>
</section>
HTML;
    return $output;
}
Beispiel #2
0
<?php

use Roots\Sage\Titles;
$thumb_url = $post ? wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'headline-thumb')[0] : '';
$duo_url = \Firebelly\Media\get_duo_url($post, ['size' => 'headline-thumb']);
$recess = $post ? get_post_meta($post->ID, '_cmb2_recess', true) == 'on' : '';
?>

<div class="page-header" style="background-image: url('<?php 
echo $duo_url ? $duo_url : '';
?>
');">
  <div class="bg-dots"></div>
  <h1 class="headline-title"><span class="gradient-highlight"><?php 
echo Titles\title();
?>
</span></h1>
</div>


Beispiel #3
0
<?php

$thumb_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'medium')[0];
$duo_url = \Firebelly\Media\get_duo_url($post, ['size' => 'medium']);
$link = get_post_meta($post->ID, '_cmb2_link', true);
?>

<a href="<?php 
echo $link;
?>
" target="_blank"><img src="<?php 
echo $duo_url;
?>
"></a>

Beispiel #4
0
<?php

$thumb_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'person-thumb')[0];
$duo_url = \Firebelly\Media\get_duo_url($post, ['size' => 'person-thumb']);
if ($thumb_url) {
    $photo_duo = '<img src="' . $duo_url . '" class="wp-post-image">';
    $photo_color = get_the_post_thumbnail($post->ID, 'person-thumb');
} else {
    $photo_duo = '<div class="no-thumb wp-post-image" width="372" height="246"></div>';
    $photo_color = $photo_duo;
}
$name = $post->post_title;
$title = get_post_meta($post->ID, '_cmb2_title', true);
$show_title = get_post_meta($post->ID, '_cmb2_show_title', true) == 'on';
$body = apply_filters('the_content', $post->post_content);
$person_num = isset($i) ? "data-person-num=\"{$i}\"" : '';
?>

<div data-url="<?php 
echo get_permalink($post);
?>
" id="<?php 
echo $post->post_name;
?>
" class="person" <?php 
echo $person_num;
?>
>
  <?php 
echo $photo_duo;
?>