Skip to content

Instantly share code, notes, and snippets.

View dariodev's full-sized avatar

Dario Devcic dariodev

  • Zagreb
View GitHub Profile
@woogists
woogists / wc-change-number-of-related-products.php
Last active February 9, 2024 16:37
[Theming Snippets] Change number of related products output
@justintadlock
justintadlock / one-theme-two-textdomains.php
Last active March 23, 2021 18:56
How one theme can have two textdomains and still work with translation systems.
<?php
/**
* The purpose of this file is to show how a theme can have multiple textdomains
* and still work with a single translation file. Translation tools like the
* one used on WordPress.org and Poedit are going to simply scan the project for
* text strings, regardless of the textdomain (and for good reasons that are
* not relevant here).
*
* The code below works with that system. It assumes that we have a single MO
* file based on the theme's textdomain. So, how can two textdomains work? It
@johnbillion
johnbillion / wp_mail.md
Last active June 3, 2024 13:31
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@thiagoeliasr
thiagoeliasr / swiper-magnific-popup.js
Created August 13, 2015 13:27
Adding swipe support to Magnific Popup galleries. (touchSwipe is required: http://labs.rampinteractive.co.uk/touchSwipe/demos/)
(function() {
/* Define a variável que dá swipe no lightbox */
var magnificPopup = $.magnificPopup.instance;
/* Carrega a função quando clica no lightbox (senão não pega a classe utilizada) */
$("a.image-lightbox").click(function(e) {
/* Espera carregar o lightbox */
setTimeout(function() {
/* Swipe para a esquerda - Próximo */
<?php
/**
* Kirki Advanced Customizer
*
* This is a sample configuration file to demonstrate all fields & capabilities.
*
* CAUTION:
* USE THIS WITH THE DEVELOP BRANCH ON THE GITHUB REPOSITORY:
* https://github.com/aristath/kirki/tree/develop
*
@yangshun
yangshun / youtube-vimeo-url-parser.js
Last active June 14, 2023 22:27
YouTube Vimeo URL Parser
function parseVideo (url) {
// - Supported YouTube URL formats:
// - http://www.youtube.com/watch?v=My2FRPA3Gf8
// - http://youtu.be/My2FRPA3Gf8
// - https://youtube.googleapis.com/v/My2FRPA3Gf8
// - Supported Vimeo URL formats:
// - http://vimeo.com/25451551
// - http://player.vimeo.com/video/25451551
// - Also supports relative URLs:
// - //player.vimeo.com/video/25451551
@justintadlock
justintadlock / register-post-type.php
Last active July 17, 2024 10:14
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@brankoajzele
brankoajzele / fiskalizacija.php
Last active December 1, 2022 17:26
Kompletan primjer fiskalizacije (Croatian fiscalization act/law).
<?php
/**
* @author Branko Ajzele <ajzele@gmail.com, http://foggyline.net>
*/
$XMLRequestType = 'RacunZahtjev'; /* RacunZahtjev OR PoslovniProstorZahtjev */
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@luetkemj
luetkemj / wp-query-ref.php
Last active May 25, 2024 10:56
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/