WordPress.org

Support

Support » Themes and Templates » [Theme: P2] Choose category for posts

[Theme: P2] Choose category for posts

  • [Theme: P2] Why can’t I set a category when I post using this theme? It seems to me the most basic feature for posting on any blog theme. Others have asked this question and gone unanswered. Does Automattic still support this theme? Or have they abandoned it?

    http://wordpress.org/extend/themes/p2/

Viewing 6 replies - 1 through 6 (of 6 total)
  • It just turned it on on my installation and works just fine for me. Category shows up where it is supposed to be.

    Please see the screenshot.
    https://dl.dropbox.com/u/39206157/p2-theme.png
    I can set the post as:
    Status Update
    Blog Post
    Quote
    Link
    I can upload an image. I can give the post a title and tags, but where do I set the category.

    astromono

    @astromono

    Alright, I had this issue and I’ve been thinking about it, so I think I discovered how to add the category dropdown list:

    First you need to edit the post-form.php file in you P2 Theme. So go to your editor and in post-form.php add the following at the end of line 74:

    <?php wp_dropdown_categories(); ?>

    Now, if you refresh your site you’ll see the dropdown showing up on top of your Post It button in all formats, but you gotta edit it to look better.

    What I did in this case was reduce the width of the input#tags down from 75% to 50% like this:

    #postbox input#tags {width:50%;}

    And that’s it. You might need to clear your cache before you see the changes, since this theme relies heavily on ajax.

    If you have categories that don’t show in the dropdown, it’s probably because the dropdown will not show cats that don’t have posts in them. So add a post to the category you want to see and it will show up on the list.

    Note that if you’re using a child theme, for some reason the width of the input#tags won’t work if you change it in the child theme stylesheet. Yeah, I know editing core CSS files (or any file for that matter) sucks, but I don’t know why P2 doesn’t play well with child themes.

    Also, you might be interested in knowing that Jonathan Warren made a kickass child theme for P2 that adds responsiveness to the markup, making it work seamlessly with tablets and cel phones 🙂

    https://github.com/nmec/p2-responsive

    astromono

    @astromono

    Ah, forget about what I said earlier. The code I placed only lists your categories, but doesn’t actually assign them to the post.

    I was actually able to do this with the info in these links:

    http://wpguru.co.uk/2012/04/how-to-bring-back-post-categories-in-p2/

    http://wpguru.co.uk/2012/03/how-to-tweak-p2-adding-and-replacing-categories/

    Cheers and good luck!

    r_27

    @alaa27

    how to assign these categories to the post?

    I mean in categories, the categories that admin can add them from the dashboard, Not the categories that appear in p2 theme(quote, status update….)

    astromono;

    Could you be clearer about your recipe for success?

    I tried to follow the instructions in the posts you reference but could not get to the point where from the post form I could display a list of my categories and let one be associated with a post.

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Theme: P2] Choose category for posts’ is closed to new replies.