WordPress.org

Ready to get started?Download WordPress

Forums

Putting in blog into page, should the loop work? (2 posts)

  1. Adriandc
    Member
    Posted 2 years ago #

    Hi all, Im new to PHP , but am working on a site which is nearly finished, the issue is that it is working off its own theme which I didnt create.

    But basically im looking to simply have one page that displays the blog. I found http://codex.wordpress.org/The_Loop and tried to copy the basic loop into my page

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <!-- do stuff ... -->
    <?php endwhile; ?>
    <?php endif; ?>

    I have also included <?php define('WP_USE_THEMES', false); get_header(); ?> at the top of the page as per instructions.
    Ive also made sure that page is calling the correct template.

    but nothing happens, I appreciate this is probably an obvious one and its a matter of learning more but im wondering can someone help me out.

    Do I also need to put that loop into index.php even if Im not using it for my main home page?
    Here is the page.. asystec.hailstormcommerce.com/?page_id=56

    Thanks

  2. s_ha_dum
    Member
    Posted 2 years ago #

    Is your page a theme template file? Or is it external to WordPress? If it is a template file do not define WP_USE_THEMES as false.

    You don't have to have a Loop if you aren't using it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.