Support » Fixing WordPress » How to inline (all) posts on specific page in custom theme?

  • Resolved MD84



    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><!-- end hoofdItem -->
    				<?php endwhile; ?>
    			<?php endif; ?>
                <?php if (is_front_page()) : ?>
                	<div class="actieBanner">
                		Onze Acties
    				<?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(); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi


    Forum Moderator

    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


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to inline (all) posts on specific page in custom theme?’ is closed to new replies.