wordpress echo slug从数组到带有计数的表格单元格

时间:2016-11-27 18:11:42

标签: php mysql wordpress

我想要的是通过slug名称数组并回应slu count数。 帖子类型是'电影'&分类学'流派'。我之前有工作代码但不在表格的单元格内。

<table width="100%">

<?php 

$genre_array = array( "action", "adventure", "animation", "biography", "comedy", "crime", "documentary", "drama", "family", "fantasy", "film-Noir", "history", "horror", "music", "musical", "mystery", "romance", "sci-Fi", "sport", "thriller", "war", "western" );

for ($x = 0; $x<21; $x++) { ?>

<tr border-bottom: 1px thick #fff;>

<td class="movie_genre" style="width: 120px;">

<?php echo $genre_array[$x]; ?>

</td>

<td class="movie_genre" style="width: 40px; color: #ddd;">
                                -
</td>

<td class="movie_genre">

<?php

$movie_genre = $genre_array[$x];

echo $movie_genre->count;

?>

</td>

</tr>

<?php } ?>

</table>

希望帮助近在咫尺 史蒂芬

0 个答案:

没有答案