我有一个archives-movies.php,可以输出我想要的信息。
在$rat
变量中,我想输出值以及我上传到主题目录/ img / stars /的图像,并在文件夹0,1,2中输出单独的文件夹,所有单独的文件夹中都有3,4 ... 10和star.png。
<?php
$nam = get_post_meta( get_the_ID(), "name", true );
$rel = get_post_meta( get_the_ID(), "released", true );
$rat = get_post_meta( get_the_ID(), "rating", true );
$dur = get_post_meta( get_the_ID(), "duration", true );
$gen = get_post_meta( get_the_ID(), "genre", true );
$dir = get_post_meta( get_the_ID(), "director", true );
$wri = get_post_meta( get_the_ID(), "writer", true );
$sta = get_post_meta( get_the_ID(), "stars", true );
$sto = get_post_meta( get_the_ID(), "storyline", true );
?>
<div class="align_Left">
<p><b>Title:</b> <?php echo $nam; ?></p>
<p><b>Released:</b> <?php echo $rel; ?></p>
<p><b>Rating:</b> <?php echo $rat; ?>/10</p><img src="<?php echo get_theme_directory_uri() ;?>/img/stars/<?php echo $rat; ?>/star.png">
<p><b>Duration:</b> <?php echo $dur; ?> min</p>
<p><b>Genre:</b> <?php echo $gen; ?></p>
<p><b>Director/s:</b> <?php echo $dir; ?></p>
<p><b>Writer/s:</b> <?php echo $wri; ?></p>
<p><b>Stars:</b> <?php echo $sta; ?></p>
<p><b>Storyline:</b> <?php echo $sto; ?></p>
</div>
<?php wp_reset_postdata() ?>
但是不起作用。