Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tahirtaous
tahirtaous / NextPrevious Pages function NOT posts
Last active August 29, 2015 14:13
WordPress Next & Prevous Page not Post with Bootstrap pager styling
<!-- add this code in page.php to display Next page and Previous page link below pages in WordPress
this will display next and previous page link not next previous post link
http://codex.wordpress.org/Next_and_Previous_Links#The_Next_and_Previous_Pages -->
<?php
$pagelist = get_pages('sort_column=menu_order&sort_order=asc');
$pages = array();
foreach ($pagelist as $page) {
$pages[] += $page->ID;
}
@tahirtaous
tahirtaous / Se hidden WordPress database settings
Last active August 29, 2015 14:13
See all database related WordPress setting
// CUSTOM ADMIN MENU LINK FOR ALL SETTINGS Under Setting Menu
function all_settings_link() {
add_options_page(__('All Settings'), __('All Settings'), 'administrator', 'options.php');
}
add_action('admin_menu', 'all_settings_link');
@tahirtaous
tahirtaous / bootstrap-jumbotron-wp-widget
Created January 8, 2015 20:45
Create WordPress widget with Bootstrap Jumbotron styling
// Add this to your wordpress themes functions.php to register widget with bootstrap's jumbotron styling
register_sidebar( array(
'name' => __( 'Featured below navigation', 'twentytwelve' ),
'id' => 'sidebar-featured',
'before_widget' => '<div class="jumbotron"><aside id="%1$s" class="container %2$s">',
'after_widget' => '</aside></div>',
'before_title' => '<h1>',
@tahirtaous
tahirtaous / unregister-sidebar
Created January 8, 2015 20:36
WordPress : Unregistering Parent Theme Sidebar in Child Theme
// Remove 2012 default sidebar widgets from admin area
// http://codex.wordpress.org/Function_Reference/unregister_sidebar
// following code will remove/unregister 2012 sidebars from admin area
// you can unregister any sidebar just replave sidebar-1 sidebar-2 and sidebar-3 with your sidebar id. you can find sidebar id's
// in parent theme's functions.php file
// http://codex.wordpress.org/Function_Reference/unregister_sidebar for more details
function remove_some_widgets(){
// Unregister some of the TwentyTen sidebars
unregister_sidebar( 'sidebar-1' );