• I started this thread in the installation section but didn’t get any replies. You can check out my self-dialogue(dialectic?) here.

    Here’s the simple question: I want to embed just the loop into an html document. I’ve found a simple loop that adds only the last post:

    <?php
    			global $post;
    			$args = array( 'numberposts' => 1);
    			$myposts = get_posts( $args );
    			foreach( $myposts as $post ) :	setup_postdata($post); ?>
    
    			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    
    			<?php the_content(); ?>
    
    		<?php endforeach; ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Can I just put that in my html doc, then make a WordPress installation in a subdirectory?

    This is purely academic at this point because I’ve gone ahead and created my own theme using the html. In the future I’d like to be able to simply insert the loop into pages where desired.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘embedding loop into html doc’ is closed to new replies.