Skip to content

Instantly share code, notes, and snippets.

View krystyna93's full-sized avatar
🏠
Working from home

krystyna krystyna93

🏠
Working from home
  • Victoria, Australia
View GitHub Profile
@neilgee
neilgee / custom-tax.php
Last active December 18, 2021 14:01
Output a Custom Taxonomy Loop of Terms
<?php
// Taxonomy Loop
/**
* Get the Custom Taxonomy
* For a list of other parameters to pass in see link below
* @link https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
* For a list of get_term return values see link below
* @link https://codex.wordpress.org/Function_Reference/get_term
@KelliePetersen
KelliePetersen / seo-checklist.md
Last active July 2, 2025 15:01
SEO Checklist updated for 2019
@KelliePetersen
KelliePetersen / design-resources.md
Last active June 6, 2023 12:43
Front-End Design Tools Compilation
@mahlamusa
mahlamusa / extend-wp-rest-api.php
Last active June 1, 2023 10:38
Extend WordPress REST API with custom rest fields and endpoints
<?php
/**
* Register custom rest fields
*/
add_action( 'rest_api_init', 'register_custom_fields' );
/**
* Register rest fields and endpoint
*
@geoffduke
geoffduke / page.php
Created October 15, 2018 14:06
Adding breadcrumb and side menus to WP_Themes
<!-- breadcrumb -->
<?php
$theParent = wp_get_post_parent_id(get_the_ID());
if ($theParent) { ?>
<div class="metabox metabox--position-up metabox--with-home-link">
<p><a class="metabox__blog-home-link" href="<?php echo get_permalink($theParent); ?>"><i class="fa fa-home" aria-hidden="true"></i> Back to <?php echo get_the_title($theParent); ?></a> <span class="metabox__main"><?php the_title(); ?></span></p>
</div>
<?php }
?>
@kafleg
kafleg / sanitize-functions.php
Created July 24, 2018 10:54
Sanitize Function for WordPress
<?php
/**
* Customizer: Sanitization Callbacks
*
* This file demonstrates how to define sanitization callback functions for various data types.
*
* @package code-examples
* @copyright Copyright (c) 2015, WordPress Theme Review Team
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License, v2 (or newer)
*/
@sajdoko
sajdoko / Theme_Customization_API.php
Created June 26, 2018 15:46
Wordpress Customizer API Sanitization Examples
<?php
///////////////////////////////
// HOW TO SANITIZE RADIO BOX //
///////////////////////////////
function theme_slug_customizer($wp_customize) {
//your section
$wp_customize->add_section(
'theme_slug_customizer_your_section',
array(
'title' => esc_html__('Your Section', 'theme_slug'),
@DavidPeralvarez
DavidPeralvarez / front-end-posting.php
Created May 17, 2018 15:48
WordPress Plugin Front End Posting
<?php
/*
Plugin Name: Front End Posting
Description: Create posts from the front end
Author: David Perálvarez
Version: 1.0
Author URI: https://silicodevalley.com
*/
// Front end submission form
@maddisondesigns
maddisondesigns / functions.php
Last active August 5, 2025 09:32
WooCommerce Custom Fields for Simple & Variable Products
/*
* Add our Custom Fields to simple products
*/
function mytheme_woo_add_custom_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
// Text Field
@nfsarmento
nfsarmento / ajax-filter-posts.js
Created March 11, 2018 12:42
Ajax filters for CPT with custom taxonomy
(function($) {
'use strict';
jQuery(document).ready(function() {
//Load all posts
asr_ajax_get_postdata(-1);
$('.asr_texonomy').on('click',function(){
var term_id = $(this).attr('data_id');