Hey folkens, jeg har det problem at jeg ikke kan få The Events Calendar pluginet til at vises der hvor mine normale "posts" normalt bliver vist.
Jeg har googlet mig frem til at jeg skal bruge denne kode (https://theeventscalendar.com/support/forums/topic/events-not-appearing-in-main-blog-loop/)
query_posts( array(
'post_type'=> array('post', 'tribe_events'),
'paged' => $paged,
'cat' => $category,
'posts_per_page' => $post_number
));
PROBLEMET ER BARE AT JEG IKKE KAN FINDE UD AF AT SÆTTE DET IND!
Den kode det skal sættes ind i er denne:
<?php
$cat = '';
if ( ot_get_option( 'home_news_category' ) ) :
$cat = ot_get_option( 'home_news_category' );
endif;
$the_query = new WP_Query(array(
'post_type' => 'post',
'posts_per_page' => 4,
'offset' => 0,
'cat' => $cat
));
if ( $the_query->have_posts() ) : ?>
<!--<div class="thumbnails">-->
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div <?php post_class( 'span3' ); ?>>
<?php if ( has_post_thumbnail() ) { // the current post has a thumbnail ?>
<div class="img">
"><?php the_post_thumbnail( 'portfolio', array( 'class' => '' ) );?>
<span class="img-hover"><i class="icon-circle-arrow-right"></i></span>
</div>
<?php } ?>
<div class="caption">
<h4><?php if (is_sticky()) { echo '<i class="icon-pushpin sticky" title="Sticky"></i> ';}?>"><?php the_title(); ?></h4>
<?php echo spritz_posted_on(); ?>
</div>
</div>
<?php endwhile;
wp_reset_postdata(); ?>
<!--</div>-->
<?php endif; ?>
<?php wp_cache_flush(); ?>