Skip to content

Instantly share code, notes, and snippets.

View netwizards's full-sized avatar

Krzysztof netwizards

View GitHub Profile
@netwizards
netwizards / template-functions.php
Created May 30, 2023 08:40 — forked from interplaydesign/template-functions.php
wp_nav_menu_objects filter
/**
* Menu customizations
*/
add_filter('wp_nav_menu_objects', 'intro_nav_menu_objects', 10, 2);
function intro_nav_menu_objects( $items, $args ) {
//If our menu has the id primary-menu in the wp_nav_menu in our header.php
if ( $args->menu_id == 'primary-menu' ){
//var_dump( $items );
//For each item in the menu. the $item->ID is the menu item ID not the page/post ID
//The post id will be the $item->object_id if it is a post/page
@netwizards
netwizards / kinsta_users.php
Created September 12, 2019 13:13 — forked from carlodaniele/kinsta_users.php
A plugin for registering a custom post type with a specific set of capabilities
<?php
/**
* @package Kinsta_users
* @version 1.0
*/
/*
Plugin Name: Kinsta users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@carlodaniele
carlodaniele / kinsta_users.php
Last active December 14, 2021 21:40
A plugin for registering a custom post type with a specific set of capabilities
<?php
/**
* @package Kinsta_users
* @version 1.0
*/
/*
Plugin Name: Kinsta users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);