WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type's Archive in WP Nav Menu
Loading gif always visible (5 posts)

  1. helgatheviking
    Member
    Posted 1 year ago #

    The metabox on the menu page for the custom archives seems to have its ajax loading gif visible at all times. Please see the screenshot:

    http://www.diigo.com/item/image/1xt6v/9yvr

    http://wordpress.org/extend/plugins/add-custom-post-types-archive-to-nav-menus/

  2. KimTasker
    Member
    Posted 12 months ago #

    I had the same issue, but fixed it. Actually, the plugin meta-box isn't structured as it should be, some of the code needs to be changed.
    If you open cpt-in-navmenu.php in the plugin folder, towards the end of the file you'll find :

    echo '<div id="cpt-archive" class="posttypediv">';
    echo '<div id="tabs-panel-cpt-archive" class="tabs-panel tabs-panel-active">';
    echo '<ul id="ctp-archive-checklist" class="categorychecklist form-no-clear">';
    echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $post_types), 0, (object) array( 'walker' => $walker) );
    echo '</ul>';
    echo '</div><!-- /.tabs-panel -->';
    echo '</div>';
    echo '<p class="button-controls">';
    echo '<span class="add-to-menu">';
    echo '<img class="waiting" src="' . esc_url( admin_url( 'images/wpspin_light.gif' ) ) . '" alt="" />';
    echo '<input type="submit"' . disabled( $nav_menu_selected_id, 0 ) . ' class="button-secondary submit-add-to-menu" value="' . __('Add to Menu', 'andromedamedia') . '" name="add-ctp-archive-menu-item" id="submit-cpt-archive" />';
    echo '</span>';
    echo '</p>';

    If you replace it with the following (only some minor changes) :

    echo '<div id="cpt-archive" class="posttypediv">';
    echo '<div id="tabs-panel-cpt-archive" class="tabs-panel tabs-panel-active">';
    echo '<ul id="ctp-archive-checklist" class="categorychecklist form-no-clear">';
    echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $post_types), 0, (object) array( 'walker' => $walker) );
    echo '</ul>';
    echo '</div><!-- /.tabs-panel -->';
    echo '<p class="button-controls">';
    echo '<span class="add-to-menu">';
    echo '<input type="submit"' . disabled( $nav_menu_selected_id, 0 ) . ' class="button-secondary submit-add-to-menu right" value="' . __('Add to Menu', 'andromedamedia') . '" name="add-ctp-archive-menu-item" id="submit-cpt-archive" />';
    echo '<span class="spinner"></span>';
    echo '</span>';
    echo '</p>';
    echo '</div>';
      added "right" to the submit button class
      deleted the <img /> of the ajax gif
      added <span class="spinner"> after the submit button
      the <div id="cpt-archive"> must include all the box so the closing </div> goes at the end

    that's it

  3. helgatheviking
    Member
    Posted 12 months ago #

    Thanks for sharing your solution!

  4. Juarez P. A. Filho
    Member
    Posted 10 months ago #

    Works like a charm! Thanks @KimTasker

  5. Marco Panichi
    Member
    Posted 10 months ago #

    Yeah it works!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.