开发者 | christopher.amirian |
---|---|
更新时间 | 2014年7月13日 16:05 |
PHP版本: | 3.9 及以上 |
WordPress版本: | 3.9.1 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
UIKIT WP Intergrator
currently is using UIKIT
version 2.8.0
Here is the list of settings available:
uikit-wordpress-integrator
directory into to the /wp-content/plugins/
directoryNo, your theme already has the UIKIT framework integrated
Yes, just uncheck addons from settings page of the plugin located under Settings -> UIKIT Integrator menu
Add this code inside functions.php
of your theme:
add_theme_support( 'menus' );
if (function_exists('register_nav_menus')) {
$locations = array(
'primary' => 'Primary Navigation'
);
register_nav_menus( $locations );
}
function nav_menu_item_parent_classing( $classes, $item )
{
global $wpdb;
$has_children = $wpdb -> get_var( "SELECT COUNT(meta_id) FROM {$wpdb->prefix}postmeta WHERE meta_key='_menu_item_menu_item_parent' AND meta_value='" . $item->ID . "'" );
if ( $has_children > 0 )
{
array_push( $classes, "uk-parent" );
}
return $classes;
}
add_filter( "nav_menu_css_class", "nav_menu_item_parent_classing", 10, 2 );
class Child_Wrap extends Walker_Nav_Menu
{
function start_lvl(&$output, $depth = 0, $args = array())
{
$indent = str_repeat("\t", $depth);
$output .= "\n$indent