WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to inline (all) posts on specific page in custom theme? (3 posts)

  1. MD84
    Member
    Posted 4 years ago #

    Hey,

    I am new in using WordPress as a CMS for my websites. I got stuck, so I've searched the internet for many hours, but cannot find an answer that works for me. So I will post it here.

    My issue:
    I have a page named 'home' which I set as front page via the built-in function. On this page I am showing some content (text). Underneath this content I want to show my posts (making it partially a blog page). The problem is that I do not know how to script this.

    Below you will find my page.php file. I do not know what code to use at the location where I echo.

    <?php get_header(); ?>
    
    	<div id="main">
    
        	<div id="mainLeft">
    
            	<?php if (have_posts()) : ?>
    
                	<?php while (have_posts()) : the_post(); ?>
    
                    	<div class="hoofdItem">
    
                        	<div class="hoofdItemContent">
    
                            	<span class="hoofdItemContentTitel"><?php the_title(); ?></span><br />
    
    							<?php the_content(); ?>
    
    						</div>
    
    					</div><!-- end hoofdItem -->
    
    				<?php endwhile; ?>
    
    			<?php endif; ?>
    
                <?php if (is_front_page()) : ?>
    
                	<div class="actieBanner">
    
                		Onze Acties
    
                	</div>
    
    				<?php echo 'This line will does echo! But what code to put here, in order to show my posts?'; ?>
    
                <?php endif; ?>
    
    		</div><!-- end mainLeft -->
    
            <?php get_sidebar(); ?>
    
           	<div class="clear"></div>
    
    	</div><!-- end main -->
    
    <?php get_footer(); ?>
  2. esmi
    Forum Moderator
    Posted 4 years ago #

  3. MD84
    Member
    Posted 4 years ago #

    Thanks a lot! Now I know where to look for.

    And by the way, I solved it.
    I copied and pasted the loop from index.php into page.php (where I echoed). I've added
    <?php query_posts('category_name=acties&posts_per_page=-1'); ?>
    above the new pasted loop and voila... it worked.

    * being 'acties' as my category name, and
    * -1 showing all posts

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic