I have created custom post types and added some things through advanced custom fields.
Usually when i don’t need to select from each category i would do something like this.
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
<?php the_field('name_of_field'); ?>
endwhile; else: ?>
<?php endif; ?>
However now i have to select if it is one of two particular categories and then put category ‘tjanster’ in left column and ‘produkter’ in right column within my bootstrap grid.
So it will be 50% ‘tjanster’, 50% ‘produkter’.
I have been searching like crazy for an solution but only found some code for functions.php that didn’t work and 5years old posts that didn’t work for me.
What am i suposed to to so i can have some similar output like this?
<div class="container">
<div class="row">
<div class="col-sm-6">
<!-- Output of category tjanster. -->
</div>
<div class="col-sm-6">
<!-- Output of category produkter. -->
</div>
</div>
</div>
For each column you need a WP_Query(). See codex for reference: http://codex.wordpress.org/Class_Reference/WP_Query.