• Hello,

    I am trying to create a Page Template called Blog.php so whenever I create a page and use this template it will display all my blog titles. The problem is that it’s not displaying what i want. The the_title() is displaying the name of the page and not the title of the blogs. The the_peralink() is just displaying the page link (ie url.com/blog) and not the link of the actual blogs.

    <?php
    /*
    Template Name: Blogs
    */
    ?>

    <?php get_header(); ?>

    <!– CONTENT –>

    <div id=”content”>

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <?php the_title() ?>
    <?php the_permalink() ?>
    <?php the_excerpt(); ?>

    <?php endwhile; ?>
    <?php else : ?>
    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>

    <!– /CONTENT –>

    <?php get_footer(); ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Create a Page Template – not displaying correctly’ is closed to new replies.