WordPress博客代码函数的调用分别意思-wordpress&系统-0660BBS_0660bbs

WordPress博客代码函数的调用分别意思

旱船 2018-9-5 3499

WordPress博客代码函数的调用分别意思。

<?php
                     $args = array(
                     'posts_per_page' => -1,
                     'showposts' => 2,
                     'cat'=> array(198,138),
                     
                     );
                     $sticky_posts = new WP_Query( $args ); 
                     while ( $sticky_posts->have_posts() ) : $sticky_posts->the_post();?>
                         <li>
                         <a href="<?php the_permalink() ?>" target="_blank" ><?php the_title(); ?></a>
                         </li>
                         <?php endwhile; wp_reset_query();?>

以上代码所包含的代码的意思如下:

<?php the_permalink() ?>文章的链接
<?php the_title(); ?>文章名称


最新回复 (0)
全部楼主
返回