WordPress.org

Ready to get started?Download WordPress

Forums

Assign categories to Pages? (25 posts)

  1. notthatugly
    Member
    Posted 8 years ago #

    As anyone who's used a theme without a page.php will know, all Pages are automatically set to the default category. I would like a way of assigning a category to a Page (so I could, for example, put my 'wordpress help' page in the 'wordpress' category along with my wordpress templates). Is there a plugin or hack that would enable me to do this? I don't mind messing with function files if I have to.

  2. nateomedia
    Member
    Posted 8 years ago #

    Uh, why not just make "wordpress help" a category?

  3. Kafkaesqui

    Posted 8 years ago #

    Could you set up your "wordpress templates" as a Page template and assign that to your 'wordpress help' Page? Assuming these we are talking about a template specific to the 'wordpress' category.

    http://codex.wordpress.org/Pages#Page_Templates

  4. notthatugly
    Member
    Posted 8 years ago #

    Uh, why not just make "wordpress help" a category?

    Because I cannot assign a Page to the category 'wordpress help' any more than I can put it into the category 'wordpress'. Why do you think giving the category another name would change things?

    So the current possible solutions are:

    a) per Kaf's suggestion, I make Page templates which include the template lists (which are technically category archives) along with the help text. I like this because it encourages people to read the help section.

    b) I make category templates including a manual link to the relevant Pages (could probably be done with a single category.php)

    c) Or I could delve into the database and see whether it's possible to specify a category manually.

    Wow, am I really the first person ever who's wanted to categorise their Pages?

  5. Lorelle
    Member
    Posted 8 years ago #

    No, you are not the first, but the purpose of Pages in WordPress has gotten out of control in its usage. They were meant to be the pages like "About", "Schedule", "Copyright", "Legal Policies", not for whole sections or grouping with other information. People who are still thinking static HTML pages (like I did) have a hard time getting their head about the idea of post vs page.

    I started out putting a bunch of stuff in Pages and then realized that it just wasn't working. I moved them into posts, gave them categories, and now I have a power over the ability to add and connect information in very exciting ways, expanding what I thought of as Pages into exciting project sets.

    Since Pages were added with 1.5, maybe they will have categories in future editions. I'm sure it's on the list. But for now.....

  6. Jinsan
    Member
    Posted 8 years ago #

    the purpose of Pages in WordPress has gotten out of control in its usage

    I'm not sure if that's a logical comment - if that were true, no one would use WP for anything other than blogging. Instead people are testing and pushing the limits of WP into other directions, try to work around any limitations. You can't call something a CMS and then say a feature is being used out of control.

    Categorising pages is a fair and valid request, and it also makes sense in terms of orgainsation.

    Or we can just go back to static forever scrolling HTML pages with neon counters, or how about no images? Because we wouldn't want to go crazy with ideas now would we?

    If we do get cats for pages, is anyone that uses it going to be called a nutjob?

  7. buzz
    Member
    Posted 8 years ago #

    I agree that we should be able to assign a category to a page. Either that or be able to hide the byline. Having a page that is labeled as "uncategorized" just doesn't look right.

  8. nateomedia
    Member
    Posted 8 years ago #

    I didn't completely understand the initial request. The only thought I can offer is that you could hardcode your WordPress Help Page into your WP category template (if you've got a separate template for WP), otherwise you could use a conditional statement to get the link to appear -- if ( is_category ( '#' ) ) { echo "<a>WordPress Help</a>" }.

  9. banjolawyer
    Member
    Posted 8 years ago #

    I would like to be able to assign categories to pages, or hide the the byline as mentioned above. The default category just doesn't make sense on some pages.

  10. Dgold
    Member
    Posted 8 years ago #

    I don't fully understand this either, but I'm getting more out of what Lorelle said. Is she basically suggesting, type your "page" information into a post and categorize the post, instead of making it a page?

  11. moshu
    Member
    Posted 8 years ago #

    To those complaining about the default category appearing in Pages: it means you do not have a page.php template in your theme, so WP is using your index.php to display the content of the Pages. Just save your index.php as page .php and edit/delete whatever you find "nonsense" on a Page.

  12. banjolawyer
    Member
    Posted 8 years ago #

    Thanks. that works.. my problem was I was copying the page.php file from the default theme into my custom theme, and that didn't work. (I got that idea from the codex at http://codex.wordpress.org/Pages#Creating_your_own_Page_Templates) Copying the index.php from my custom theme and renaming to page.php worked.

  13. David Borrink
    Member
    Posted 8 years ago #

    "Since Pages were added with 1.5, maybe they will have categories in future editions. I'm sure it's on the list. But for now....."

    Ah, so what I'd like to do.... isn't possible yet? I want to add a second set of pages to my sidebar under a different category than "Main". My "Main" header has pages "About (me)", "About (the site), "Contact (me)", etc. I'd like to have another Category of "Resources" and have separate pages for "Books", "Music". I'm assuming by the discussion here that it's not possible yet with WP 1.5?

  14. notthatugly
    Member
    Posted 8 years ago #

    If posts were suitable for static, undated information which needs to be easily accessible from the sidebar, I'd have used posts. They're not, which is why we have Pages.

    In the end, I decided to take the content of my Pages and turn them into php includes. This is the system I was using pre-1.5, and it fits my needs better than Pages since it gives me much more flexibility in how it's presented. Page categories would still be handy, though; at the moment I'm having to enter all links to Pages manually because I want different types under different headings.

    (And I never said it should be in the core. This thread is under 'Plugins and Hacks' for a reason. ;) )

  15. drobbins
    Member
    Posted 8 years ago #

    You can hack around and assign categories to pages - I've done it before; I ran into problems once I started using more functions and plugins that dealt with categories, though, so I guess I would consider if you have much of that going on. However, like some of the posts above suggests, I found it to be too problematic at times, and found a better solution incorporating tags and such. Anyway, I have no idea what I'm doing, but I would be happy to try and look at the files again and see if I can remember what I did.

  16. sito
    Member
    Posted 8 years ago #

    Hi,

    After reading the entire thread, I am not exactly sure if a "solution" was mentioned? Well, anyway, just to put in my two cents worth.

    The way I went about it today was to define a page as the "parent" page - this can be a blank entry. The title of this entry will act as the category heading. Next I created all pages relevant to the category to be under this parent. By manually coding the category headings and then using the following

    <?php wp_list_pages('sort_column=ID&child_of=12&title_li='); ?>

    where 12 = ID of the parent entry, I can then get a "categorized" listing of relevant pages.

    Hope this helps your particular application!?

  17. wessex
    Member
    Posted 8 years ago #

    I do something similar to Sito, except I use the excellent "Fold Page List" plugin from
    http://www.webspaceworks.com/wp-plugins/foldpagelist.html

    Thus the parent page 'pretends' to be a page category. Clicking the parent page name loads the parent page and displays its child pages below it.

    The only awkward bit about this way is that the parent page actually has to have some content. In this case I generally put a bit of text about that particular 'fake category'.

    Perhaps a messy way of doing it, but it works!

  18. seogirl
    Member
    Posted 8 years ago #

    Well, I came here in search of an answer to my problem of not being able to assign pages to a "category". I'm using Journalized Winter and after saving index.php as page.php, I finally gave up. I made a blank "parent page" as suggested and made my pages the child. However, it still would not put the pages created my under the category headings I had set up.

    When I am speaking of a "Category", I am actually referring to the "Get Links" function of being able to input a link location and have it automatically appear under a heading you have assigned (in my case on the right sidebar). I want to be able to have my pages listed under specific headings.

    My solution was to use the styles.css file in an html file I created and just make them independent pages that I linked in using my link categories. A lot more work, but the css allows it to have the same look and feel.

    Hopefully the makers of the 1.6 will be listening....I love the idea of a "live" site (i.e, the blog postings) but there needs to be a middle ground of being able to present "pages" that are dateless and don't change. If WP is to be a true CMS, this must be more flexible.

  19. sito
    Member
    Posted 8 years ago #

    Hi seogirl,

    I am afraid I don't quite understand what you are describig in your first paragraph? Do you have an example?

    I believe that either
    1. the use of a dummy parent page (and using wp_list_pages with the childof option). Note that in this method, a parent page is not a true category and so cannot be accessed as a normal category.
    2. "fold page list" plugin as suggested by wessex
    should be able to do what you want for the second point.

  20. duckster
    Member
    Posted 7 years ago #

    I'm pretty sure this thread is where I want to weave. I'm using a modified version of K2. I've created some Pages via Create Page. I'd like to be able to "Blog" on each page - to have posts with comments, etc. I thought I might be able to do this with some sort of php command on the Page, but have not stumpled across one just yet...

    For instance on my "News" page, have <php get "news">. (I know that's not right code, but you get the picture?

    This would allow me some static comment on top of the page, and then the posts would appear under them...

  21. wbhamilton
    Member
    Posted 7 years ago #

    I'm wanting to do the same thing as duckster...also on a modified k2 (slightly).

    Any direction would be appreciated?

  22. moshu
    Member
    Posted 7 years ago #

    For what duckster wanted you don't need a Page - just customized Category Templates... and some reading in the Codex.

  23. athenavoltaire
    Member
    Posted 7 years ago #

    I know this is so over a year ago and after the fact but Jinsan is right...

    The purpose of a bicycle was to get from point A to point B faster.... tell that to Lance Johnson Lorelle lol

    WordPress is becoming an CMS because of pushing the limits!

    It still isn't and my post is a year after this discussion.... should you doubt me, check joomla. Unfortunately for Joomla, as of presently, its not very search engine friendly tagging is a nightmare with it and only frontpage "news" posts get indexed. I suppose one day, wordpress will meet joomla and they'll call it heaven :-)

  24. duckster
    Member
    Posted 7 years ago #

    BTW, I found a genius at getafreelancer.com that was able to implement what I wanted in my k2 themed blog!

  25. jabecker
    Member
    Posted 7 years ago #

    I have a need to have groups of static pages that are referenced from my sidebar or from other "parent pages."

    I use a plugin called List Manager (http://www.navidazimi.com/projects/wp-lists/) to group the pages the way I want and then display the list of pages in the sidbar. List Manager accepts a URI, which I use to link the title of the page in the sidebar to the page itself. This is how I built the finished objects list in the right sidebar.

    I've also used List Manager to add an index of static pages to a parent page that is accessed from my nav bar -- i.e. "freebies" displays two lists and "galleries" displays a list of galleries.

    What I really like about this solution is that I can create a new page on the fly from anywhere that I have computer access, and then by simply adding the page title and URI to the relevant list via the admin console, I can display the link where I want it. I don't have to edit any template or sidebar or mess around with WP innards.

    At least not to do that.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.