How to echo category selection? (1 post)

  1. kaylamatthews
    Posted 4 years ago #

    I have a posting system on my WordPress by which users can select categories from two drop-down menus - first drop-down being top level category, and second drop-down being sub-categories for the selected top level category.

    My question right now is that the posts are not being categorized correctly at all. They keep getting put into the first top level category in the top level category list. I think the issue lies in my inability to call out the result of the selected category effectively.

    The HTML <select> form looks like the following in the adding-post php page:

    [code moderated - please use the http://pastebin.com/ ]

    The function in function.php for the AJAX menu looks like this:

    [code moderated - please use the http://pastebin.com/ ]

    And finally, the code I am using to call out the result of the category selection is:

    [please use the 'code' button to mark any code posted directly]

    <?php echo ($_POST['form']['sub_cat']); ?>

    If anybody can offer any help that would be really great! I have been studying this for over 3 days :'(


Topic Closed

This topic has been closed to new replies.

About this Topic