Last post in loop when even

<?php if( have_posts() ) : ?> <?php $count = 0; ?> <?php while( have_posts() ) : the_post(); ?> <?php global $count; $col=”col-lg-6″; if($count%3 == 0) { $col=”col-lg-12″; } else { $col=”col-lg-6″; } $count++; ?> <article id=”post-<?php the_ID(); ?>” <?php post_class( $col ); ?>> […] […] […] </article> <?php endwhile; ?> <?php endif; ?>

Archive: Lists itself

As @Milo told me in the comments, the problem lies in the fact, that the archive template shouldn’t be applied to a page, but left untouched. That way WordPress will still know which template to use for displaying an archive but you can’t access the template itself, which means it will not display itself in … Read more

Bootstrap tabs are not being clicked in WordPress loop

I think that’s because Bootstrap use document.on(‘click’, ‘selector’, function ). This means that the function will execute only when the click event reached the document Node. I tested and If you have a parent element which does not propagate the ‘click’ event, then that can be a reason of why your code doesn’t work… Ex: … Read more

get_posts changes main query

get_posts() isn’t modifying the main query. The problem is that you’re overwriting the global $post variable in your foreach loop. I guess if you’re in a template then you’re in the same scope as the global variable and don’t need to specify global $post; for this to happen (as you would if you were inside … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)