Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@philliproth
philliproth / gist:6f94201a0716b00176141d3e295efb63
Created April 18, 2023 12:35
Klasse "dark" zu body hinzufügen bei Klick auf Button mit class="mode-changer"
<script>
const darkBtn = document.querySelector('.mode-changer');
const bodyEl = document.querySelector('body');
const darkMode = () => {
bodyEl.classList.toggle('dark')
}
darkBtn.addEventListener('click', () => {
/* Example for child theme implementation */
function customname_register_scripts() {
$theme_version = wp_get_theme()->get( 'Version' );
wp_enqueue_script( 'customname-js', get_stylesheet_directory_uri() . '/assets/js/custom.js', array(), $theme_version, false );
wp_script_add_data( 'customname-js', 'async', true );
}
add_action( 'wp_enqueue_scripts', 'customname_register_scripts' );
function wcag_nav_menu_link_attributes( $atts, $item, $args, $depth ) {
// Add [aria-haspopup] and [aria-expanded] to menu items that have children
$item_has_children = in_array( 'menu-item-has-children', $item->classes );
if ( $item_has_children ) {
$atts['aria-haspopup'] = "true";
$atts['aria-expanded'] = "false";
}
return $atts;
@philliproth
philliproth / gist:bbb1226724858eaa07975f95506e87fe
Created February 16, 2021 12:45
Plugin for Portfolio Custom Post Type
<?php
/*
Plugin Name: Site Plugin for philliproth.de
Description: Site specific code changes for example.com
*/
/* CPT */
/* custom post types */
@philliproth
philliproth / functions.php
Created July 31, 2018 08:32
Remove Prefetch
// remove WP 4.9+ dns-prefetch
remove_action( 'wp_head', 'wp_resource_hints', 2 );
<div class="accordion"><input id="accordion-1" type="checkbox" name="accordions"><label for="accordion-1">After-party entrance</label><div class="accordion-content">
<ul>
<li>You welcome visitors to the after-party and check their badges</li>
<li>You are able to get people in the venue quickly and organised</li>
<li>You keep out unwanted guests</li>
<p><a href="https://2018.europe.wordcamp.org/volunteer-information/volunteer-roles/after-party-entrance/">Check details and apply for After-party entrance</a></p></ul></div></div>
<div class="accordion"><input id="accordion-2" type="checkbox" name="accordions"><label for="accordion-2">After-party entrance manager</label><div class="accordion-content">
<ul>
<li>You are responsible for after-party entrance workforce</li>
<li>You set the mood for the team to get people excited to enter the party</li>
.page-id-40711 .wrapper p {
height: 0px;
margin: 0px;
}
.page-id-40711 .tab {
position: relative;
margin-bottom: 1px;
width: 100%;
color: #fff;
<?php
$terms = get_terms( 'countries' );
if ( $terms && !is_wp_error( $terms ) ) {
echo '<ul>';
foreach ( $terms as $term ) {
echo '<li><a href="' . get_term_link( $term->term_id ) . '">' . $term->name . '</a></li>';
}
echo '</ul>';
}
<img src="http://www.buecherkinder.de/zeug/foto_sandra-400.jpg" width="240" height="240" scale="0">
Hallo, ich bin Steffi, die "Chefin" von Buecherkinder.de und freue mich, dass es nach dem Webseiten-Relaunch im November 2014 nun auch diesen Blog gibt, der von mir und den Redaktions-mitgliedern gefüllt wird.
This is for verifying my blockchain name.