Habe den eintrag erweitert
Die Admin-Bar wird nun dauerhaft im Header angezeigt, jedoch keine schöne Lösung.
Ich hab mir die functions.php und costumizer.php angesehen, konnte aber nicht wirklich sehen wo ich diese einstellungen "Mobile-ansicht Adminb-bar im footer" vorgenommen hätte.
functions.php
PHP
<?php
register_nav_menu('primary','topmenu');
/*--admin-bar--*/
add_action( 'admin_bar_menu', 'remove_wp_logo', 999 );
function remove_wp_logo( $wp_admin_bar ) {
$wp_admin_bar->remove_node( 'wp-logo' );
}
add_action( 'wp_before_admin_bar_render', 'add_all_node_ids_to_toolbar' );
function add_all_node_ids_to_toolbar() {
global $wp_admin_bar;
$all_toolbar_nodes = $wp_admin_bar->get_nodes();
if ( $all_toolbar_nodes ) {
$args = array(
'id' => 'node_ids',
'title' => 'Node ID\'s'
);
$wp_admin_bar->add_node( $args );
foreach ( $all_toolbar_nodes as $node ) {
if ( isset($node->parent) && $node->parent ) {
$args = array(
'id' => 'node_id_'.$node->id,
'title' => $node->id,
'parent' => 'node_ids'
// 'href' => $node->href,
);
$wp_admin_bar->add_node($args);
}
}
foreach ( $all_toolbar_nodes as $node ) {
$args = array(
'id' => 'node_id_'.$node->id,
'title' => $node->id,
// 'href' => $node->href,
);
if ( isset($node->parent) && $node->parent ) {
$args['parent'] = 'node_id_'.$node->parent;
} else {
$args['parent'] = 'node_ids';
}
$wp_admin_bar->add_node($args);
}
}
}
/*--css and script--*/
add_action( 'init', 'mmx_load_scripts' );
function mmx_load_scripts() {
wp_enqueue_script( 'my-theme-js', get_template_directory_uri() . '/js/function.js', array( 'jquery' ), '1.1', true);
wp_enqueue_script( 'my-customizer-js', get_template_directory_uri() . '/js/theme-customizer.js', array( 'jquery' ), '1.1', true);
wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css');
}
add_action( 'wp_enqueue_scripts', 'drweb_add_font_awesome' );
function drweb_add_font_awesome() {
wp_enqueue_style( 'font-awesome', 'https://opensource.keycdn.com/fontawesome/4.6.3/font-awesome.min.css' );
}
/*--widget--*/
function first_widgets_init() {
register_sidebar(array(
'name' => 'Sidebar Widgets',
'id' => 'sidebar_widgets',
'description' => 'Widgets ausgabe für Sidebar',
'before_widget' => '<div class="sidebar_widget">',
'after_widget' => '</div>',
'before_title' => '<h1>',
'after_title' => '</h1>',
) );
}
add_action( 'widgets_init', 'first_widgets_init' );
function secend_widgets_init() {
register_sidebar(array(
'name' => 'About Widgets',
'id' => 'about_widgets',
'description' => 'Widgets ausgabe für About Me',
'before_widget' => '<div class="col-lg-6">',
'after_widget' => '</div>',
'before_title' => '<h1>',
'after_title' => '</h1>',
) );
}
add_action( 'widgets_init', 'secend_widgets_init' );
function third_widgets_init() {
register_sidebar(array(
'name' => 'Sidebar Beitrag Widgets',
'id' => 'sidebar_beitrag_widgets',
'description' => 'Widgets ausgabe für Beitrag uns Seiten Ausgabe',
'before_widget' => '<div class="sidebar-beitrag">',
'after_widget' => '</div>',
'before_title' => '<div class="sidebar-inhalt-header"><h2>',
'after_title' => '</h2></div>',
) );
}
add_action( 'widgets_init', 'third_widgets_init' );
function fourth_widgets_init() {
register_sidebar(array(
'name' => 'Footer Widgets',
'id' => 'footer_widgets',
'description' => 'Widgets ausgabe für Footer',
'before_widget' => '<div class="col-lg-4">',
'after_widget' => '</div>',
'before_title' => '<div class="sidebar-inhalt-header"><h2>',
'after_title' => '</h2></div>',
) );
}
add_action( 'widgets_init', 'fourth_widgets_init' );
function fivth_widgets_init() {
register_sidebar(array(
'name' => 'Front-site Widgets',
'id' => 'front_widgets',
'description' => 'Widgets ausgabe für Front-Site',
'before_widget' => '<div id="main-content-area" class="hidden">',
'after_widget' => '</div>',
'before_title' => '<h1>',
'after_title' => '</h1>',
) );
}
add_action( 'widgets_init', 'fivth_widgets_init' );
function sixt_widgets_init() {
register_sidebar(array(
'name' => 'Secend-site Widgets',
'id' => 'secend_widgets',
'description' => 'Widgets ausgabe für die 2.Main-Bereich neben Adout-Me',
'before_widget' => '<div class="col-lg-4">',
'after_widget' => '</div>',
'before_title' => '<h1>',
'after_title' => '</h1>',
) );
}
add_action( 'widgets_init', 'sixt_widgets_init' );
/*--costum Header--*/
add_theme_support( 'custom-header' );
$args = array(
'flex-width' => true,
'random-default' => true,
'width' => 2200,
'height' => 1080,
'default-text-color' => '',
'header-text' => true,
'default-image' => get_template_directory_uri() . '/img/category1.jpg',
'default-text-color' => '',
'header-text' => true,
'uploads' => true,
'wp-head-callback' => '',
'admin-head-callback' => '',
'admin-preview-callback' => '',
'video' => false,
'video-active-callback' => 'is_front_page',
);
add_theme_support( 'custom-header', $defaults );
add_action( 'after_setup_theme', 'themename_custom_header_setup' );
add_theme_support ('custom-logo');
function themename_custom_logo_setup() {
$defaults = array(
'height' => 50,
'width' => 400,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title', 'site-description' ),
);
add_theme_support( 'custom-logo', $defaults );
}
add_action( 'after_setup_theme', 'themename_custom_logo_setup' );
require get_template_directory() . '/customizer.php';
?>
Alles anzeigen
customizer.php
PHP
<?php
function Ari_customize_register( $wp_customize ) {
$colors = array();
$colors[] = array(
'slug'=>'content_text_color',
'default' => '#333',
'label' => __('Content Text Color', 'Ari')
);
$colors[] = array(
'slug'=>'content_link_color',
'default' => '#88C34B',
'label' => __('Content Link Color', 'Ari')
);
$colors[] = array(
'slug'=>'content_link_hover_color',
'default' => '#88C34B',
'label' => __('Content Link Hover Color', 'Ari')
);
foreach( $colors as $color ) {
$wp_customize->add_setting(
$color['slug'], array(
'default' => $color['default'],
'type' => 'option',
'capability' =>
'edit_theme_options'
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
$color['slug'],
array('label' => $color['label'],
'section' => 'colors',
'settings' => $color['slug'])
)
);
}
}
add_action( 'customize_register', 'Ari_customize_register' );
Alles anzeigen
Slipi