WordPress.org

Ready to get started?Download WordPress

Forums

Posts on different pages? (9 posts)

  1. testify1988
    Member
    Posted 1 year ago #

    My website has several different categories, how would I configure wordpress to allow me to add a post to a specific page?

    And, ideally, link to it from the index page.

    Cheers

  2. Santosh
    Member
    Posted 1 year ago #

    you can create a page for each category and add this to page template
    it will show you posts of particular category

    <?php
    				query_posts(array('category_name' => 'news','posts_per_page' => '4','post__not_in'=>get_option('sticky_posts')));
    			?>
    			<?php while (have_posts()) : the_post(); ?>
    
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<h3 class="bg">
    				<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>
    			</h3>
    				<p><?php the_post_thumbnail(array(250,250), array ('class' => 'alignleft')); ?></p>
    				<p><?php the_excerpt(); ?>

    you need to add your category name here "'category_name' => 'news',".

  3. mnuworld
    Member
    Posted 1 year ago #

  4. testify1988
    Member
    Posted 1 year ago #

    That's no help whatsoever but cheers anyway.

  5. Santosh
    Member
    Posted 1 year ago #

    for showing post from particular category on a page you need to create a page and use a template in which you can write above code just customize it. Than you have all the post from one category.

  6. testify1988
    Member
    Posted 1 year ago #

    I don't even know what that means.

    You have a custom theme across the entire site, how is it even possible to have a different theme for each page?

  7. testify1988
    Member
    Posted 1 year ago #

    Sorry Santosh, I did not see your earlier post.

    I will try that now.

  8. Santosh
    Member
    Posted 1 year ago #

    before implementing this you need to create page templates for each category. I hope you know how to create page template.

  9. testify1988
    Member
    Posted 1 year ago #

    yeah, that just gives me an error.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.