?> <div id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php if (get_post_type($post) == 'post') { $imagethumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'Post1'); $post_counter++; $post_alternative_cat_tag = get_post_meta($post->ID, 'post_alternative_cat_tag', true); $post_tag_new = get_post_meta($post->ID, 'post_tag_new', true); $postsAverageReview = get_post_average_review($post->ID); $post_categories = wp_get_post_categories($post->ID); $format = get_post_format($post->ID); if ($post_categories) { $cats = array(); foreach ($post_categories as $c) { $cat = get_category($c); $cats[] = array('id' => $cat->cat_ID, 'name' => $cat->name); } $cat_id = $cats[0]['id']; $cat_name = $cats[0]['name']; $cat_link = get_category_link($cats[0]['id']); } ?> <div class="single-post-thumb">
} $postsNeeded[$counter]['cat_id'] = $cats[0]['id']; $postsNeeded[$counter]['cat_name'] = $cats[0]['name']; $postsNeeded[$counter]['cat_link'] = get_category_link($cats[0]['id']); } else { $postsNeeded[$counter]['cat_id'] = ''; $postsNeeded[$counter]['cat_name'] = ''; $postsNeeded[$counter]['cat_link'] = ''; } $counter++; $post_selected = pego_get_post_by_title($postposition8, $output1 = OBJECT); $postsNeeded[$counter]['id'] = $post_selected->ID; $postsNeeded[$counter]['title'] = $post_selected->post_title; $postsNeeded[$counter]['format'] = get_post_format($post_selected->ID); $postsNeeded[$counter]['permalink'] = get_permalink($post_selected->ID); $postsNeeded[$counter]['average_rate'] = get_post_average_review($post_selected->ID); $postsNeeded[$counter]['PostSection41'] = wp_get_attachment_image(get_post_thumbnail_id($post_selected->ID), 'PostSection41'); $postsNeeded[$counter]['PostSection31'] = wp_get_attachment_image(get_post_thumbnail_id($post_selected->ID), 'PostSection31'); $postsNeeded[$counter]['PostSection21'] = wp_get_attachment_image(get_post_thumbnail_id($post_selected->ID), 'PostSection21'); $postsNeeded[$counter]['PostSection22'] = wp_get_attachment_image(get_post_thumbnail_id($post_selected->ID), 'PostSection22'); $postsNeeded[$counter]['PostSection11'] = wp_get_attachment_image(get_post_thumbnail_id($post_selected->ID), 'PostSection11'); $postsNeeded[$counter]['PostSection12'] = wp_get_attachment_image(get_post_thumbnail_id($post_selected->ID), 'PostSection12'); $postsNeeded[$counter]['post_alternative_cat_tag'] = get_post_meta($post_selected->ID, 'post_alternative_cat_tag', true); $postsNeeded[$counter]['post_tag_new'] = get_post_meta($post_selected->ID, 'post_tag_new', true); $post_categories = wp_get_post_categories($post_selected->ID); if ($post_categories) { $cats = array(); foreach ($post_categories as $c) { $cat = get_category($c); $cats[] = array('id' => $cat->cat_ID, 'name' => $cat->name); if ($cat->category_parent == 0) {