예제 #1
0
<?php

$tag = segment(2);
if (!$tag) {
    show_404();
}
$tag = urldecode($tag);
$posts = get_posts_by_tag($tag);
include_header(array("title" => "Tag " . $tag));
?>

    <h1 class="text-center">Články s tagom <?php 
echo plain($tag);
?>
</h1>

    <?php 
if (count($posts)) {
    foreach ($posts as $post) {
        ?>
        <div class="post">

            <h2><a href="<?php 
        echo $post["link"];
        ?>
"><?php 
        echo $post["title"];
        ?>
</a></h2>

            <div class="post-info">
예제 #2
0
foreach ($taxonomies['crew'] as $slug => $crew_name) {
    $crew .= !empty($crew) ? ', ' : '';
    $crew .= '<a href="' . get_term_link($slug, 'crew') . '">' . $crew_name . '</a>';
}
foreach ($taxonomies['organizer'] as $slug => $organizer_name) {
    $organizer .= !empty($organizer) ? ', ' : '';
    $organizer .= '<a href="' . get_term_link($slug, 'organizer') . '">' . $organizer_name . '</a>';
}
$people = array();
foreach ($taxonomy_objects['crew'] as $slug => $crew_term) {
    $people[] = get_avatar($crew_term->description, '102', '', $crew_term->name);
}
$images = get_children('post_parent=' . $post->ID . '&post_type=attachment&post_mime_type=image');
$taxes = get_blogtrip_taxonomies(array('post' => $post->ID));
$term_id = get_term_by('slug', $custom_meta['departure_blogtrip_hashtag'][0], 'post_tag');
$blog_object_ids2 = get_posts_by_tag($custom_meta['departure_blogtrip_hashtag'][0], 'DESC', 4);
// setup photo style - style from *.pds
$image_sizes = array('large' => array('width' => 396, 'height' => 252), 'medium' => array('width' => 244, 'height' => 252), 'thumb' => array('width' => 153, 'height' => 153));
$photo_styles = array(array('class' => 'prime', 'width' => $image_sizes['large']['width'], 'height' => $image_sizes['large']['height'], 'type' => 'large'), array('class' => 'sub-prime', 'width' => $image_sizes['medium']['width'], 'height' => $image_sizes['medium']['height'], 'type' => 'medium'), array('class' => 'sub', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub push-2', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub push-4', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub push-6', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'));
// setup photo style - 12 thumbs
$photo_styles = array(array('class' => 'sub', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub push-2', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub push-4', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub push-6', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub push-2', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub push-4', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub push-6', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub push-2', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub push-4', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'), array('class' => 'sub push-6', 'width' => $image_sizes['thumb']['width'], 'height' => $image_sizes['thumb']['height'], 'type' => 'thumb'));
$count_photo = count($photo_styles);
// include twitter script
$tweet_params = array('hashcode' => $custom_meta['departure_blogtrip_hashtag'][0], 'since_id' => $custom_meta['_departure_tweet_since_id'][0], 'until' => date('Y-m-d', $custom_meta['departure_date_end'][0]), 'since' => date('Y-m-d', $custom_meta['departure_date_start'][0]), 'live' => time() < $custom_meta['departure_date_end'][0] ? true : false, 'page_tweets' => $page_tweets, 'photo_count' => $count_photo);
$photo_cached = array();
$i = 0;
foreach ($images as $post_image) {
    $image_custom_fields = get_post_custom($post_image->ID);
    $large = $medium = $thumb = '';
    $image = wp_get_attachment_image_src($post_image->ID, array($image_sizes['large']['width'], $image_sizes['large']['height']), false);
    if ($image) {