1
最初のショートdivの内側のdivを生成した:私は1つのページにブログ記事のループを含む2つのショートコードを追加するときに、ショート工場の内部そのもの最初のショートコードの外側のdiv、これは私のPHPコードのいくつかにも起こります、おそらくあなたはエラーを見つけることで、その日を救うことができますか?セカンドショートは、私は複数のショートが1ページに</p> <p>問題をブログ記事ループを生成する追加しようとしています
ここでは、その第二列(ショートから二番目のループが始まるこれは、行が本質的な問題である、広いです)が表示されます:私が追加した場合
を
html出力では、2番目のループが最初のループ "行"に埋め込まれていることがわかります。 https://ibb.co/h7pOpb
マイshortcode.php:あなたが出力を返すとき
<?php
$city = the_terms($post->ID , "'.$city.'");
/*** HOME ***/
function blog_loop_mtl($atts) {
extract(shortcode_atts(array(
'type' => 'post',
'perpage' => 20,
'city' => 'Montreal'
), $atts));
echo '<div class="clear"></div>';// Outter Container open
$args = array(
'post_type' => $type,
'posts_per_page' => $perpage,
'city' => $city
);
$splendid_query = new WP_Query($args);
echo '<div class="row">';// Row Open
while ($splendid_query->have_posts()) : $splendid_query->the_post();
$category = get_the_category();
echo '<div class="col-xs-6 col-sm-4 grid-entry-wrapper"> <!-- grid-entry-wrapper open -->
<div class="post_grid_entry">
<div id="grid_entry_meta">
<div class="boujee">
<a href="' . get_category_link($cats[0]->cat_ID) . '" style="color: white">' . $category[0]->cat_name . '</a>
</div>
<div>
' . $city . ' <i class="fa fa-map-marker" aria-hidden="true"></i>
</div>
</div>
<a href="' . get_permalink() . '">
<div class="grid_thumbnail" >
<div class="grid_thumbnail" style="background-image: url('.get_the_post_thumbnail_url().')" alt="">
</div>
</a>
<a href="'.get_author_posts_url(get_current_user_id()). '">'. get_avatar(get_the_author_meta('id')) . '</a>
</div>
<div>
<a href="' . get_permalink() . '"></a>
<h3 class="post_grid_title">
<a href="' . get_permalink() . '">'. get_the_title(). '</a>
</h3>
</div>
<div id="grid_entry_meta_publ">
<div>
Published ' . time_elapsed_string(get_the_date()). '
</div>
<div>
by <a href="'.get_author_posts_url(get_the_author_meta('id')). '">'. get_the_author_meta('display_name') . '</a>
</div>
</div>
</div><!-- grid-entry-wrapper close -->
</div>'; // Row Close
endwhile;
wp_reset_query();
}
add_shortcode('blog_loop_mtl', 'blog_loop_mtl');
あなたが欠けているように見える