Skip to content

Instantly share code, notes, and snippets.

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

Khandaker Ikrama khikrama

🏠
Working from home
View GitHub Profile
@badcrocodile
badcrocodile / year-month-archive-list.php
Created June 15, 2015 01:01
Generate a year -> month based list of posts in WordPress, similar to the native Archives widget, only with months being children of years as oposed to a flat list
<?php // In functions.php:
/* -- Year and month based archive listings -- */
function posts_by_year() {
// array to use for results
$years = array();
// get posts from WP
$posts = get_posts(array(
'numberposts' => -1,
'orderby' => 'post_date',
@igorbenic
igorbenic / gateway.php
Last active February 21, 2024 21:32
How to create a custom WooCommerce Payment Gateway
<?php
// ...
function woo_payment_gateway() {
class Woo_PayPal_Gateway extends WC_Payment_Gateway {
}
}
@josegomezr
josegomezr / plugin.php
Created April 28, 2019 02:08
WooCommerce base custom payment gateway
<?php
/*
Plugin Name: Custom Payment Gateway
Description: Custom payment gateway example
Author: Lafif Astahdziq
Author URI: https://lafif.me
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
@erikyuzwa
erikyuzwa / wordpress-6-2-2-docker-compose.yml
Last active July 15, 2024 14:39
Wordpress 6.2.2 Docker Compose for Local Development
# create a local .env file with the following 4 properties:
#
# MYSQL_DATABASE=<something>
# MYSQL_USER=<something>
# MYSQL_PASSWORD=<something>
# MYSQL_ROOT_PASSWORD=<something>
#
# Note: I have had a LOT of issues working with anything newer then Docker Desktop v4.26.1
# If you're on something newer, then double check against this release.
#