Wordpress help.

Man of Honour
Joined
17 Feb 2003
Posts
29,640
Location
Chelmsford
Currently, each time i wish to add new articles or reviews etc to my website, i have to write them in traditional HTML text. This isn't that hard but at times inconvenient. So I thought I'd have a go at wordpress so I can post my reviews into their relevant categories. but it seems like you can't.

In a nutshell, I'm trying to post to different pages. Foreaxmple,to post my games reviews on the Games Review pages, and my tecnhical stuff on another Tenchiocal page. But each both only appears on the front pages, regardless of the catgeory i post it to.

I'm pretty sire this is a limitation unless there is some kind of plugin to post entries to a specific page.


http://www.huddysworld.co.uk/TheAdmiralsLog/
 
Hey Paul its Rob. Just sorting out you a wordpress example but heres a little information for you.

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


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:


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 a lot of stuff to do, but its not really at all.

Aternatively have a look here: http://wordpress.org/extend/plugins/advanced-category-excluder/
 
..snip..advanced-category-excluder/[/url]




Hi Rob, Welcome to the forums :)

I have just read through that and it seems this is for excluding categrories rather than adding them to the pages.




They do post under specific pages/categories, e.g. http://www.huddysworld.co.uk/TheAdmiralsLog/?cat=3

Wordpress by default just lumps them all together for the home page, edit the homepage template to whatever you need and bobs your Aunties live in lover.

Gotcha.. So i can view my posts by category.. So how do I see that category when I click on the page tab? For example, I click on the "PC Games tab I want to see the PC games Category.
 
Ah heres an easier example to just make your header links show catagories in your pages.

<ul>
<li><a href="<?php bloginfo('home'); ?>">Home</a></li>
<?php wp_list_pages('depth=1&sort_column=menu_order&title_li='); ?>
<li><a href="<?php bloginfo('url'); ?>/?cat=3">Preferred</a></li>
<?php wp_list_categories('depth=1&exclude=3,7&title_li='); ?>
</ul>

This would add only the parent cats (depth=1) and would exclude the categories with ID 3 and 7; the last parameter is preventing the code to add the usual “Categories” heading.

Think thats about right.
 
Bumping this,

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.

Ok I have no idea how to do this.. I've looked at the header.php but there is nothing there I can see I can change.

Thanks.
 
Last edited:
Back
Top Bottom