jeudi 26 mars 2015

different post types on same page in 2 separate columns


I'm pretty new to wordpress and am working on creating a child theme (parent theme is Avenue). I've created 2 different custom post types and now would like to display them on the same page in 2 different columns. I've created separate loops for them using different wp_queries for them to be called correctly. They show up on the page, but the only way I can get them to be side by side is to assign the right column with a margin-top of -500px. I know this is not the correct way of doing it and it is not very responsive. Below is my code. Any help would be greatly appreciated.


front-page: 'page', 'order' => 'ASC' ); $the_query = new WP_Query( $args );



$args_review = array(
'post_type' => 'reviews',
'order' => 'ASC'
);
$quote_query = new WP_Query( $args_review );

$args_links = array(
'post_type' => 'magazines',
'order' => 'ASC'
);
$link_query = new WP_Query( $args_links );
?>

<?php if ( have_posts() ) : while ( $the_query->have_posts()) :
$the_query->the_post(); ?>

<?php get_template_part('content', 'page'); ?>

<?php endwhile; endif; // end of the loop. ?>
<?php wp_reset_postdata(); ?>

<?php if ( have_posts() ) : while ( $quote_query->have_posts()) :
$quote_query->the_post(); ?>

<?php get_template_part('content_two', 'page'); ?>

<?php endwhile; endif; // end of the loop. ?>
<?php wp_reset_postdata(); ?>

<?php if ( have_posts() ) : while ( $link_query->have_posts()) :
$link_query->the_post(); ?>

<?php get_template_part('content_three', 'page'); ?>

<?php endwhile; endif; // end of the loop. ?>
<?php wp_reset_postdata(); ?>


content_two-page (this calls the first custom post)



<div class = "reviews-content">
<div class = "left_col">
<div class = "bg_quote">
<?php the_field('title'); ?>
</div>
<?php the_field('reviews'); ?>
<?php the_field('date'); ?>
</div>
</div>


content_three-page (this calls the second custom post)



<div class = "mag-content">
<div class = "right_col test">
<?php the_field ( 'links' ); ?>
<?php the_field ( 'summary' ); ?>
</div>
</div>




1 commentaire:

  1. Casinos Near Hollywood, LA – MapyRO
    Discover the nearest casinos and 광양 출장샵 other popular casinos 성남 출장마사지 in 전라남도 출장안마 Hollywood, LA. Find reviews and 광양 출장마사지 news on where to 전라남도 출장마사지 stay closest to Hollywood, LA.

    RépondreSupprimer