Code to have one category in a page
because for me it’s very simple to use the system of the articles instead of use html text. I think it’s just a question of replace the text of my home page by one who show only one category
because for me it’s very simple to use the system of the articles instead of use html text.
This just doesn’t make sense as an aswer to my question: Why a Page (and I really mean that you read that article!!!) when the Category Template does exactly what you want: displays posts from one single category.
it’s just a question of replace the text of my home page by one who show only one category
Changing “text”, a.k.a. content on your homepage has nothing to do with how posts are displayed. I guess you meant “code”.
If that’s what you want: displaying posts only from a certain category on your homepage… the why don’t you ask THAT question? Don’t assume you know the HOW. You, obviously, don’t.
So better describe WHAT you want to achieve, and we will tell you the how-to.
For excluding posts from the homepage – you need a plugin.
Like this one: http://wordpress.org/extend/plugins/advanced-category-excluder/
Thank you for your answer, excuse my poor english i am french.
I’ve find some days ago the php code to exclude the category n°9 to my homepage so no problem.
Now the thing is to display the content of this category 9 in an other page wich show the content like that link:
My question is simple what code (php) i have to insert in this page to display just this category? how can i build a page (virgin) with simple code wich show the content of one category
I’d think a Category Template would serve you.
If it is required that a Page handle this then you want to look at the query post category parameters also.
My question is simple what code (php) i have to insert in this page to display just this category?
You don’t have to anything. WP does it for you out of the box.
sorry to be a such noob but when i insert the following code :
<?php query_posts(‘cat=9’); ?>
in my page it doesn’t show the content of my category :/
Sorry but i am not very good at php and i do this site for my school i’m quite lost with all this stuff.
Can you give me all the code i have to insert in my page?
Or where can i find this code in what file?
Whenever we are talking about code – it must be put in the files, never in the content of a Page or of a post.
I still don’t understand WHY are you trying to do this the hard way. Why not simply use the Category Templates as it was told several times?
What is the reason you want stubbornly this Page solution? Explain…
Because when I create a page in my wp’s interface it’s very simple because it’s create a button in the top automatically.
If i don’t use the system of a page I don’t know how to create a button like that.
We could have saved a lot of typing and time if you have posted THIS question at the very beginning… 🙂
Se if this helps:
To explain that look at my site http://cinetrip.tk/.
It’s very hard to put in form the page “bons plans”. It’s why i want to replace the content of this page by the category 9 that i have created.
Can you tell me the steps to do that?
I don’t see anything complicated in that.
Put your header.php in http://wordpress.pastebin.ca and post back the URL.
- The topic ‘Code to have one category in a page’ is closed to new replies.