Viewing 8 replies - 1 through 8 (of 8 total)
  • you can use a query_posts statement to display the posts from one category on the static page you are using as the front page
    https://codex.www.ads-software.com/Template_Tags/query_posts

    Thread Starter scoobasteve

    (@scoobasteve)

    Allright, thanks for the tip. I can’t seem to get it workin though.

    This is my code now:

    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    <div id="main">
    	<div id="main-top"></div>
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<div class="post">
    
    		<div class="post_title" id="PID-<?php the_ID(); ?>">
    			<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    		</div> <!-- close post_title -->
    
    		<div class="post_tag">
    			<?php the_time('F,Y dS') ?>
    			<?php the_time('h:i'); ?>
    			<?php if (!is_single()) {?> /
    				<?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>
    			<?php } ?>
    			<?php edit_post_link('Edit',' / '); ?>
    		</div> <!-- close post_tag -->
    
    		<div class="post_content">
    			<?php the_content(__('More...')); ?>
    		</div> <!-- close post_content -->
    
    		<?php comments_template(); ?>
    
    		<?php if (is_single()) { ?>
    			<div class="navigation">
    				<div class="alignleft"><?php previous_post_link(); ?></div>
    				<div class="alignright"><?php next_post_link(); ?></div>
    			</div> <!-- close navigation -->
    		<?php } ?>
    
    	</div> <!-- close post -->
    	<?php endwhile; else: ?>
    		<!-- No posts yet or No search results (if search.php doesn't exist)-->
    		<p>Sorry, I can't find anything like that...</p>
    	<?php endif; ?>
    	<?php if (!is_single()) { ?>
    		<div class="navigation">
    			<div class="alignleft"><?php posts_nav_link('','','&laquo; Previous Posts') ?></div>
    			<div class="alignright"><?php posts_nav_link('','Next Posts &raquo;','') ?></div>
    		</div>
    	<?php } ?>
    	<div id="main-bot"></div>
    </div><!-- main -->
    	<?php include 'sidebar2.php';?>
    <?php get_footer(); ?>
    </div><!-- close content-->
    </div><!-- close wrapper-->
    
    </body>
    
    </html>

    Where do it put the `query_posts(“cat=17”);
    ` code?

    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    <div id="main">
    	<div id="main-top"></div>
    
    ===== query_posts goes here =======
    
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<div class="post">
    Thread Starter scoobasteve

    (@scoobasteve)

    Thanks, workin now!

    Hey,
    I’m also trying to change the front page so that it shows a category.
    I think this post should work for me as well, although I’m a bit lost at how to make this “query_posts” page? Could someone please explain to me how to set this up to make it work? I’m not sure where to put this code and how to activate it. Thanks in advance!

    *edit*
    I also use Atahualpa 3.3.2, if that makes any difference.

    I’m sorry, found my error, I pasted the code in “visual” box instead of the “html” box. Sorry for the extra posts.

    I still dont get it ??

    I would like to have my news category to be my static front page. On which file should i edit with query post?

    I have page.php on my theme. Should I edit it to something like this?

    <?php get_header(); ?>
    <div id="content" class="page">
    
    	<?php 
    
    	query_posts('category_name=news');
    
    	if (have_posts()) : ?>
    	<?php while (have_posts()) : the_post(); ?>
    
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<h2><?php the_title(); ?></h2><br />
    
    			<?php the_content(); ?>
    
    		</div>
    	<?php endwhile; ?>
    
    	<?php endif; ?>
    			<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    
    		<?php comments_template(); ?>
    </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    nevermind me.. i got it done.. i should edit my index.php -.-

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Reading Settings – Frontpage Category’ is closed to new replies.