Skip to content

Instantly share code, notes, and snippets.

@wpmu-authors
wpmu-authors / customizer_function.php
Created February 5, 2021 12:41
customizer_function.php
<?php
function wpmu_customize_register( $wp_customize ) {
}
add_action( 'customize_register', 'wpmu_customize_register' );
@wpmu-authors
wpmu-authors / customizer_section.php
Created February 5, 2021 12:46
customizer_section.php
/*******************************************
Section
********************************************/
// colors section
$wp_customize->add_section( 'wpmu_colors' , array(
'title' => __( 'Colors', 'wpmu')
) );
@wpmu-authors
wpmu-authors / customizer_settings.php
Created February 5, 2021 13:10
customizer_settings.php
/*******************************************
Color settings
********************************************/
//logo position
$wp_customize->add_setting( 'wpmu_nav_color' );
$wp_customize->add_control( 'wpmu_nav_color', array (
'label' => 'Navigation Menu Color',
'section' => 'wpmu_colors',
'settings' => 'wpmu_header_color',
@wpmu-authors
wpmu-authors / nav_menu_before.php
Created February 5, 2021 13:12
nav_menu_before.php
<nav class="main">
<?php wp_nav_menu( array(
'theme_location' => 'header-menu',
'container_class' => 'menu'
) ); ?>
</nav>
@wpmu-authors
wpmu-authors / nav_menu_after.php
Created February 5, 2021 13:14
nav_menu_after.php
<nav class="main <?php echo apply_filters( 'wpmu_header_color_css', 'blue' ); ?>">
<?php wp_nav_menu( array(
'theme_location' => 'header-menu',
'container_class' => 'menu'
) ); ?>
</nav>
@wpmu-authors
wpmu-authors / wpmu_header_color.php
Created February 5, 2021 13:16
wpmu_header_color.php
function wpmu_header_color( $header_color ) {
$header_color = get_theme_mod( 'wpmu_header_color', 'blue' );
return $header_color;
}
add_filter( 'wpmu_header_color_css' , 'wpmu_header_color' );
@wpmu-authors
wpmu-authors / style.css
Created February 5, 2021 13:18
style.css
nav.main.blue
nav.main.blue a {
background: #312d72;
}
nav.main.red,
nav.main.red a {
background: #8b1b1b;
}
nav.main.green,
nav.main.green a {
@wpmu-authors
wpmu-authors / notices.html
Created February 5, 2021 13:26
notices.html
<div class="updated notice">
<p>Something has been updated, awesome</p>
</div>
<div class="error notice">
<p>There has been an error. Bummer</p>
</div>
<div class="update-nag notice">
<p>You should really update to achieve some awesome instad of bummer</p>
</div>
@wpmu-authors
wpmu-authors / simple-notice.php
Created February 5, 2021 13:28
simple-notice.php
function my_error_notice() {
?>
<div class="error notice">
<p><?php _e( 'There has been an error. Bummer!', 'my_plugin_textdomain' ); ?></p>
</div>
<?php
}
add_action( 'admin_notices', 'my_error_notice' );
@wpmu-authors
wpmu-authors / two-notices.php
Created February 5, 2021 13:30
two-notices.php
function my_error_notice() {
?>
<div class="error notice">
<p><?php _e( 'There has been an error. Bummer!', 'my_plugin_textdomain' ); ?></p>
</div>
<?php
}
add_action( 'admin_notices', 'my_error_notice' );
function my_update_notice() {