WordPress.org

Forums

P2
[Theme P2] Categories in hidden post field (2 posts)

  1. playgraph
    Member
    Posted 10 months ago #

    I'm setting up P2 theme so that the post field displays in category pages.

    I can get the category id from the page and all I want to do is simply add it to the post form.

    In the post-form.php file, I've placed
    <input type="hidden" name="post_category" id="post_category" value="<?php echo get_category(get_query_var('cat'))->cat_ID; ?>" />

    right under this line:
    <input type="hidden" name="post_format" id="post_format" value="<?php echo esc_attr( $post_format ); ?>" />

    I can view source and verify that the post_category is indeed being set in the hidden post field, but the post is not being sent to the correct category. It just goes to the default category. Is this a nonce issue?

    Please advise! Thanks!

    https://wordpress.org/themes/p2/

  2. Kathryn
    Automattic Happiness Engineer
    Posted 10 months ago #

    It sounds like you and this person both want to do something similar:

    http://wordpress.org/support/topic/add-content-from-tags-page.

    I ran it by a couple of our developers and it looks like this sort of advanced modification is something you may want to get some custom programming for, since it's beyond the type of basic tweaks we can help you with here. You would need to handle the processing of your new field in both functions.php and js/p2.js.

    Perhaps the two of you would like to communicate with each other and hire a freelancer together? This is one site you might want to try, or you could look for someone in one of your local WordPress communities: http://jobs.wordpress.net/

Reply

You must log in to post.

About this Theme

About this Topic

Tags