if (has_post_thumbnail() && is_wallpaper_pagina($post->ID) == false) { $beeld = get_the_post_thumbnail($id, array($hb, $hb), array('class' => 'beeld post-beeld ' . $class)); } print '<div class="item-pagina ' . $class_container . '">'; if ($tags) { $output_tags = '<div class="container-tags">'; foreach ($tags as $tag) { $tag_naam = $tag->name; $tag_link = get_tag_link($tag->term_id); $output_tags .= '<a title="' . $tag_naam . '" href="' . $tag_link . '">' . $tag_naam . '</a>'; } $meer = meerKleurplatenVanDezeletter($post->ID); $output_tags .= $meer; $output_tags .= '</div>'; } if (is_kleurplaten_pagina($post->ID)) { print '<div class="navigatie alfabet clearfix">'; print lettersAlfabet(); print '</div>'; $aantal = aantal_kleurplaten($post->ID); print $beeld; print '<h1 class="paginatitel">' . $titel . '</h1>'; print $output_tags; the_content(); //get_template_part('inc/inc-social'); comments_template('', false); } elseif (is_wallpaper_pagina($post->ID)) { $ouder_url = get_permalink($post->post_parent); print '<div class="subnav grid-100 clearfix">'; print '<a class="knop meer" title="Bekijk meer wallpapers" href="' . $ouder_url . '">Bekijk meer wallpapers</a>'; print '</div>';
function thema_gallery($output, $attr) { global $post, $wp_locale; static $instance = 0; $instance++; if (isset($attr['orderby'])) { $attr['orderby'] = sanitize_sql_orderby($attr['orderby']); if (!$attr['orderby']) { unset($attr['orderby']); } } extract(shortcode_atts(array('order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 5, 'size' => 'medium', 'include' => '', 'exclude' => ''), $attr)); $id = intval($id); if ('RAND' == $order) { $orderby = 'none'; } if (!empty($include)) { $include = preg_replace('/[^0-9,]+/', '', $include); $_attachments = get_posts(array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby)); $attachments = array(); foreach ($_attachments as $key => $val) { $attachments[$val->ID] = $_attachments[$key]; } } elseif (!empty($exclude)) { $exclude = preg_replace('/[^0-9,]+/', '', $exclude); $attachments = get_children(array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby)); } else { $attachments = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby)); } if (empty($attachments)) { return ''; } $itemtag = tag_escape($itemtag); $captiontag = tag_escape($captiontag); $columns = intval($columns); $itemwidth = $columns > 0 ? floor(100 / $columns) : 100; $float = is_rtl() ? 'right' : 'left'; $i = 0; $output = "<div class='gallery clearfix'>"; foreach ($attachments as $id => $attachment) { $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false); $full = get_attachment_link($id); $thumb = wp_get_attachment_image_src($id, 'thumbnail', false); $is_kpp = is_kleurplaten_pagina($post->ID); $knop_maak_eigen_kleurplaat = $knop_grote_versie = ''; if (true == $is_kpp) { $data_type = 'kleurplaat'; $ip = ip_adres_bezoeker(); //if ( '80.60.46.10' == $ip ) { $knop_maak_eigen_kleurplaat = '<a class="eigen-kleurplaat" title="Voeg tekst toe en maak je eigen, persoonlijke kleurplaat met dit plaatje!" href="/tools/persoonlijke-kleurplaat/persoonlijke-kleurplaat-maken.php?afbeelding-id=' . $attachment->ID . '" target="_blank"><i class="icon-pencil-1"></i>Voeg jouw tekst toe aan deze kleurplaat</a>'; $knop_grote_versie = '<a class="grote-versie" title="Klik om de grote versie van deze kleurplaat te bekijken en te printen" href="' . $full . '"><i class="icon-print"></i>Bekijk en print de grote versie</a>'; //} } else { $data_type = 'wallpaper'; } $output .= "<{$itemtag} itemscope itemtype='http://schema.org/ImageObject' class='gallery-item' data-type='" . $data_type . "' data-afbeelding-id='" . $attachment->ID . "'>"; $output .= $link; $output .= $knop_grote_versie . $knop_maak_eigen_kleurplaat; if ($captiontag && trim($attachment->post_excerpt)) { $output .= "<{$captiontag} itemprop='caption' class='gallery-caption'>" . wptexturize($attachment->post_excerpt) . "</{$captiontag}>"; } $output .= '<meta itemprop="thumbnailUrl" content="' . $thumb[0] . '" />'; $output .= '<meta itemprop="contentUrl" content="' . $full . '" />'; $output .= "</{$itemtag}>"; $i++; } $output .= "</div>"; return $output; }
while (have_posts()) { the_post(); $metadata = wp_get_attachment_metadata(); $url = esc_url(wp_get_attachment_url()); $b = $metadata['width']; $h = $metadata['height']; $titel_ouder = str_replace("kleurplaten", "kleurplaat", get_the_title($post->post_parent)); $titel_pagina = str_replace("kleurplaten", "kleurplaat", get_the_title()); $terug_url = get_permalink($post->post_parent); $caption = $post->post_excerpt; print '<div class="container grid-65">'; print '<div class="item-pagina">'; print '<div class="container-ga">'; get_template_part("inc/inc-ga"); print '</div>'; if (is_kleurplaten_pagina($post->ID) == true) { print '<div class="navigatie clearfix">'; if (is_attachment()) { $ouder_naam = str_replace("kleurplaten", "", get_the_title($post->post_parent)); $ouder_url = get_permalink($post->post_parent); $aantal_kleurplaten_in_cat = aantal_kleurplaten_in_categorie($post->post_parent); $class = 'kleurplaat'; $actie_prefix = 'bekijk:'; $actie_postfix = 'kleurplaat'; if (strlen($caption) > 0) { $caption = ' – ' . $caption; } print '<a title="Print deze kleurplaat" class="knop print" href="#">Print deze kleurplaat</a>'; print '<a class="knop meer" title="Bekijk ' . ($aantal_kleurplaten_in_cat - 1) . ' meer ' . $ouder_naam . ' kleurplaten." href="' . $ouder_url . '">Er zijn ' . ($aantal_kleurplaten_in_cat - 1) . ' andere ' . $ouder_naam . ' kleurplaten</a>'; print meerKleurplatenVanDezeletter($post->post_parent); if (function_exists("update_aantal_keer_bekeken")) {