WordPress.org

Ready to get started?Download WordPress

Forums

How to make post on different pages (10 posts)

  1. chlky0001
    Member
    Posted 6 years ago #

    Hi,
    I have encountered a problem and don't know how to solve it.
    I have several pages in the site, for example, News page, Article page and so on. I have several posts too, but I don't know how to make each post appear on relavent page(for example, posts about news appear on News page),I want to know if there is any method to write a post on these pages, instead editing the pages themselves.

    My site under construction:
    clubs.ntu.edu.sg/earthlink/wordpress

    Forgive me of my low skill...I really didn't find the instructions in the doc...

    Best Regards

  2. MichaelH
    Member
    Posted 6 years ago #

    Actually, you don't need to resort to Pages to do that.

    For instance, using the WordPress Default 1.6 theme, if you assign a Post to a Category, then that Category is presented as a link on your blog in the sidebar, you can click on that link and see all the Posts assigned that Category.

    You will want to review:
    Category Templates
    Template Hierarchy
    Stepping into Templates

    Now if you insist that Pages is the way to go, then you will have to develop Page templates that display posts in a particular Category. At a minimum, you will want to review The Loop and Template_Tags/query_posts.

  3. chlky0001
    Member
    Posted 6 years ago #

    Hi MichaelH,
    Thanks a lot for your explanation, but I will really need to do it in the second manner. Though I have learnt programming like c, java, yet I'm extremely unfamiliar with php and wordpress codex. I'm wondering if there is any plugin/widget can help the task, or is any place I can quickly pick up the syntax of php and wordpress codex?

  4. southisms
    Member
    Posted 5 years ago #

    Hi, I have a similar dilemma. I want to organize my podcasts in a different web page and feed them separate from my blog posts. I haven't figured out how to make a feed JUST for my podcast by merely categorizing them. I see that this question was asked 7 months ago, I want to know if there have been any developments at this point in letting the other pages have multiple posts.

  5. donperry1
    Member
    Posted 5 years ago #

    Same thing for me too. I really wish there was a way to do that. The category does not solve this problem. I really need to make post to different pages

  6. fvl2000
    Member
    Posted 5 years ago #

    Hi,

    Here is an example:

    Once your posts are in their right category eg: Podcast and News and you have 2 different pages PODCAST and NEWS that will display only posts from their correspondant category (via a page template) you can do something like:

    <li class="<?php if (is_home()) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="http://www.mydomainname.com/wordpress/">HOME</a></li>
    
    <li class="<?php if (
    is_page('7')
    || (is_single()
    && !in_category('Podcast'))//exclude posts from the podcast cat
    
    ){ ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="http://www.mydomainname.com/wordpress/news">News</a></li>
    
    <li class="<?php if (
    is_page('66')
    || (is_single()
    && in_category('Podcast'))
    
    ){ ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="http://www.mydomainname.com/wordpress/podcast">Podcast</a></li>
    
    <li class="<?php if (
    is_page('31')
    
    ){ ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="http://www.mydomainname.com/wordpress/about">ABOUT</a></li>

    After that you can also create a filter that will drive each post from a selected category into a custom template.

  7. JCBiggar1
    Member
    Posted 5 years ago #

    Having two different posting pages is pretty simple. I'm not the best at explaining things, but it isn't very hard at all.

    Now, when you write a post, you get to choose a category to put it under. Lets say you write a post and you want to put it under the category,

    My Category 1,

    Well, if you go to your wordpress website and type in

    http://www.-YOUR-DOMAIN-.com?cat=3

    or

    http://www.-YOUR-DOMAIN-.com/category/My-Category-1

    depending upon how you have your permalinks setup under the admin setting, (you can also just go to your post page, and normally the post will say something like this: posted under My Category 1.),

    you will see all the posts for that specific category. So every post you write will show up in that category archive.

    So what we want to do now is have that archive page to be the other page for posting post. So just edit the navigation bar in the header.php, and get rid of the php that makes pages show up automatically and do it manually. This isn't hard if you know what you're doing. Also, remove the h2 files in the achive.php page just to make the archive page look like a real page, and not an archive page. Normally the h2 tag with read: Archive for My Category 1.

    Now, You have done it. You have two post pages. Your regular post page, and your archive page that is blended in to look just like a regular wordpress post page.

    But we still have every thing that shows up on the My Category 1 page, on your other post page.

    Here's how to fix that.

    in the main index template (index.php), look for the php code for the post. And right after the loop, which looks something like this:

    <?php
    if ( have_posts() ) : while ( have_posts() ) : the_post();

    add this:

    if (in_category('YOUR CATEGORY ID') && is_home() ) continue;
    //This Excludes the specific category from showing up on the main page

    Now, where it says YOUR CATEGORY ID, make that be the id of your category, such as My Category 1. What this code does is excludes the category of your choice from showing up on the main page. The only way I know of to find the category id, is to change the permalink settings temporally to the default setting. Then go yourwebsite and go to the category you want to find the id of, and at the very end of it, it should say something like this:

    http://www.-YOUR-DOMAIN-.com?cat=3

    the number is the category id. Then you can switch back to your other permalink setting. (I recommend the custom post permalink which is

    /%postname%/

    Well, now you have two post pages to post on. You can tag a post to as many categories as you like, but if you post it to the category that you wish not to show on the main page, then it will not show up on the main page.

    This may seen like alot of stuff to do, but its not really at all.

    I hope this helps. God Bless! †

  8. giorgiogs
    Member
    Posted 5 years ago #

    Hi,

    I have followed this:

    if (in_category('YOUR CATEGORY ID') && is_home() ) continue;
    //This Excludes the specific category from showing up on the main page

    and it's working, but i think there is a problem i can't solve. I have setted the main page to display 5 post. Happen thet every time i add a post to the category "news" (the one i don't want to be displayed in the main page) correctly is visible only under that category but the number of post visible on the main page are 5 - the number of post in the "News" directory.
    So if i put 5 post into "News" nothing is displayed in the main page.
    I think that there is a counter that is incremented anyway for every post.
    Do you know how to handle this counter?

    Thanks

    Giorgio

  9. giorgiogs
    Member
    Posted 5 years ago #

    Ijust guess that the counter is $post , but i really don't know how to handle it inside the loop. Do you have a little example? :-)

    Thanks

    Giorgio

  10. giorgiogs
    Member
    Posted 5 years ago #

    Ok guys,

    i have found this plugin:

    http://wordpress.org/extend/plugins/advanced-category-excluder/installation/

    that make the job :-)

Topic Closed

This topic has been closed to new replies.

About this Topic