Posted on March 14, 2022 | Posted in
编程开发 | 0 Comments Replies
function wpc_elementor_shortcode( $atts ) {
$args = shortcode_atts(array("cat" => 5, "posts_per_page" => 4), $atts);
echo ("<ul class=\"newul\">");
query_posts($args);
if(have_posts()) : while (have_posts()) : the_post();
echo "<li class=\"newli\">";
if ( has_post_thumbnail() ) {
echo ("<img class=\"newimg\" src=\"");
the_post_thumbnail_url("codilight_lite_block_2_medium");
echo ("\">");
}
the_title( sprintf( '<h2 class="entry-title newtitle"><a href="%s">', esc_url( get_permalink() ) ), '</a></h2>' );
if (has_excerpt()) {
echo ("<div class=\"excdiv\">".get_the_excerpt()."</div>");
}
echo "</li>";
endwhile;
endif;
wp_reset_query();
echo ("</ul>");
}
add_shortcode( 'my_elementor_php_output', 'wpc_elementor_shortcode');
TAG CLOUD
碎碎念 生活 戏曲 古风 电影 工作 网摘 动漫 wordpress asp 模版技术 静态化 编程 风华网 php 生病 优化 seo 模板 destoon