Treehouse: Grow your CSS skills. Land your dream job.

Issue displaying Blog posts on WordPress Page

  • # June 3, 2013 at 9:24 pm

    So I’m trying to display a list of posts on a WordPress custom page template. I found an [article on wpbeginner](//www.wpbeginner.com/wp-tutorials/how-to-create-a-separate-page-for-blog-posts-in-wordpress/ “”) and followed it yet I’m having issues I posted the code for [the page](//crew3272.com/news/ “”) below.

    < ?php
    /*
    Template Name: News
    */ ?>
    < ?php get_header(); ?>

    < ?php
    $temp = $wp_query;
    $wp_query = null;
    $wp_query = new WP_Query();
    $wp_query->query(‘posts_per_page=5′.’&paged=’.$paged);
    while ($wp_query->have_posts()) : $wp_query->the_post();
    ?>
    “>

    < ?php the_title(); ?>


    < ?php the_content(); ?>
    “>Read More …
    < ?php $wp_query = null; $wp_query = $temp; ?>

    Archives

    < ?php wp_get_archives(); ?>

    < ?php get_footer(); ?>

    Any help would be greatly appreciated.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.