wppostshow - juedaiyuer/researchNote GitHub Wiki

文章显示

<?php
/**
 * @package WordPress
 * @subpackage Twenty_Fourteen
 Template Name:safteymypackage
 */

?>


<?php get_header(); ?>

<div id='content'>

<?php
$post = get_post( 354 );
$title = $post->post_title;
echo $title;
?>

<?php
        $args =array(
                'include' => 111,
                'number' => 10
        );
    $categories = get_categories($args);
    foreach ( $categories as $cat ) {
    query_posts( 'showposts=10&cat=' . $cat->cat_ID );
?>
    <h3><?php echo $cat->cat_name; ?></h3>
    <ul class="sitemap-list">
        <?php while ( have_posts() ) { the_post(); ?>
        <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
        <?php } wp_reset_query(); ?>
    </ul>
<?php } ?>

</div>

上述代码报变量错误。

source

⚠️ **GitHub.com Fallback** ⚠️