Php 如何获取home类别中的特定alt标记
如何在这段代码中获得alt image标记 我不知道我做了什么,在这段代码中,请帮助我如何才能获得类别的特定alt标记图像 谢谢。。wordpress的新手Php 如何获取home类别中的特定alt标记,php,html,wordpress,Php,Html,Wordpress,如何在这段代码中获得alt image标记 我不知道我做了什么,在这段代码中,请帮助我如何才能获得类别的特定alt标记图像 谢谢。。wordpress的新手 <div class="home-content-wrapper-preview"> <?php $paged = get_query_var('paged') ? get_query_var('paged') : 1; //Use 'page' instead of 'paged' if
<div class="home-content-wrapper-preview">
<?php
$paged = get_query_var('paged') ? get_query_var('paged') : 1; //Use 'page' instead of 'paged' if you are on home page
$Preview = get_theme_mod( 'Preview');
$args = array(
'category_name' => $Preview,
'post_type' => 'post', //Selecting post category by ID to show
'posts_per_page' => 6, //Eexcluding latest post
'paged' => $paged //For pagination
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$index= $loop->current_post + 1;
if ( has_post_thumbnail() ) {
$featured_img_url = get_the_post_thumbnail_url(get_the_ID(),'full'); }
else{
$featured_img_url = "".get_template_directory_uri() ."/placeholder.jpg";
} // get the defualt poster image when you forgot to put
$content = get_the_content();
echo "<div class='preview".$index."'>
<img src='".esc_url($featured_img_url)."'/>
<div class='post-inner'>
<h2 class='entry-title'> <a href='".get_permalink( $post->ID )."'>".$post->post_title."</a></h2>
</div>
</div>";
endwhile;
?>
</div>