Repository navigation
Page Order
Alee Javed edited this page Mar 1, 2026
·
1 revision
The page order system provides an intuitive drag-and-drop interface to reorder WordPress pages in the navigation menu.
- Drag and Drop - Intuitive page reordering
- Visual Feedback - Real-time visual updates
- Save Functionality - Persistent order changes
- Admin Integration - Built into WordPress admin
- Responsive Design - Works on all devices
- WordPress Pages - All published pages included
- Menu Order - Customizable navigation sequence
- Automatic Updates - Changes reflect immediately
- No Coding Required - Visual interface only
Go to Pages → Page Order in WordPress admin
- Drag any page to move it up or down
- Visual feedback - See changes in real-time
- Drop page in desired position
- Save Order - Click "Save Order" to apply changes
- Move Up - Move page one position up
- Move Down - Move page one position down
- Save Order - Apply changes to navigation
- Status Messages - Success/error feedback
<ul id="aleejaved-page-order-list">
<li class="aleejaved-order-item" data-id="123">
<span class="page-handle">⋮⋮</span>
<span class="page-title">Page Title</span>
</li>
</ul>-
.aleejaved-order-item- Individual page item -
.page-handle- Drag handle -
.page-title- Page name display -
.dragging- Visual feedback during drag
.aleejaved-order-item {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
border: 1px solid #c3c4c7;
border-radius: 8px;
background: #fff;
margin-bottom: 8px;
cursor: move;
}
.page-handle {
font-size: 18px;
color: #646970;
cursor: grab;
}
.page-title {
font-weight: 600;
flex: 1;
}// Move page up
function movePageUp(pageId) {
const page = document.querySelector(`[data-id="${pageId}"]`);
const prevPage = page.previousElementSibling;
if (prevPage) {
prevPage.before(page);
updateButtonStates();
}
}
// Move page down
function movePageDown(pageId) {
const page = document.querySelector(`[data-id="${pageId}"]`);
const nextPage = page.nextElementSibling;
if (nextPage) {
nextPage.after(page);
updateButtonStates();
}
}
// Update button states
function updateButtonStates() {
const items = document.querySelectorAll('.aleejaved-order-item');
items.forEach((item, index) => {
const upButton = item.querySelector('.move-up');
const downButton = item.querySelector('.move-down');
upButton.disabled = index === 0;
downButton.disabled = index === items.length - 1;
});
}function savePageOrder() {
const order = [];
document.querySelectorAll('.aleejaved-order-item').forEach((item, index) => {
order.push({
id: item.dataset.id,
order: index
});
});
fetch(ajaxurl, {
method: 'POST',
data: {
action: 'save_page_order',
page_order: order,
nonce: nonce
}
})
.then(response => response.json())
.then(data => {
if (data.success) {
showStatus('Saved!');
} else {
showStatus('Save failed!');
}
});
}- Full interface - Complete admin interface
- Large targets - Easy to drag
- Full animations - All effects enabled
- Optimized layout - Tablet-friendly
- Touch targets - Larger drag handles
- Maintains functionality - Core features preserved
- Simplified interface - Optimized for mobile
- Touch-optimized - Larger touch targets
- Essential features - Core functionality preserved
/* Custom page item styling */
.aleejaved-order-item {
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
border: 2px solid var(--accent);
}
/* Custom drag handle */
.page-handle {
color: var(--accent);
font-size: 20px;
}
/* Custom page title */
.page-title {
color: var(--text);
font-size: 16px;
}// Add keyboard shortcuts
document.addEventListener('keydown', function(e) {
if (e.ctrlKey && e.key === 's') {
savePageOrder();
}
});
// Add double-click to edit
document.querySelectorAll('.page-title').forEach(title => {
title.addEventListener('dblclick', function() {
// Enable inline editing
this.contentEditable = true;
this.focus();
});
});- Check JavaScript - Ensure page-order-admin.js is loading
- Verify HTML - Check page list structure
- Test browser - Try different browsers
- Check conflicts - Plugin or theme conflicts
- Check AJAX - Ensure save function is working
- Verify nonce - Check security token
- Test permissions - Ensure user can edit pages
- Check server response - Look for PHP errors
- Check CSS - Ensure admin styles are loading
- Verify variables - Ensure CSS variables are set
- Test responsive - Check different screen sizes 4 - Check conflicts - Plugin or theme conflicts
- Installation Guide - Setup instructions
- Customization Guide - General customization
- Troubleshooting - Common issues and solutions
- Hero Section - Related hero configuration