WordPress.org

Ready to get started?Download WordPress

Forums

+Add New Category on a custom add new page (1 post)

  1. musicmasteria
    Member
    Posted 4 years ago #

    I'm trying to create a custom add new page so that I can add content the way I want to. I'm stuck on the Add New Category part though.
    I have the code for the box but I'm missing the javascript/jquery code required for it to work. Can someone help me by finding the code/script I need to call for the +Add New Category link to work?

    I'd greatly appreciate it!

    Here's the code for the box i mentioned earlier:

    <?php if ( current_user_can('manage_categories') ) : ?>
    <div id="category-adder" class="wp-hidden-children">
    	<h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
    	<p id="category-add" class="wp-hidden-child">
    	<label class="screen-reader-text" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
    	<label class="screen-reader-text" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
    	<input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php esc_attr_e( 'Add' ); ?>" tabindex="3" />
    <?php	wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
    	<span id="category-ajax-response"></span></p>
    </div>
    <a href="categories.php" target="_blank">Add New Category</a>(Opens in a new window)<br />
    </div>
    <?php
    endif;
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic