Created
March 15, 2020 09:59
-
-
Save kaoru-fukusato/95c763163e050f7c7678b4dc9fb31bb3 to your computer and use it in GitHub Desktop.
記事ランダム③
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php query_posts(array('orderby' => 'rand', 'showposts' => 5)); | |
if (have_posts()) : | |
while (have_posts()) : the_post(); ?> | |
/* 繰り返し表示させる部分 */ | |
<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1> | |
<?php the_content(); ?> | |
<?php endwhile; endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment