Skip to content

Instantly share code, notes, and snippets.

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

Laurence Bahiirwa bahiirwa

🏠
Working from home
View GitHub Profile
@bahiirwa
bahiirwa / local gulp workflow
Created August 25, 2017 01:58
My gulp local workflow
npm init to create package.js
create gulpfile.js
Install Local dependecies
npm install --save-dev gulp gulp-autoprefixer gulp-sass gulp-uglify gulp-concat
Write gulp tasks like
const gulp = require('gulp');
const sass = require('gulp-sass');
@bahiirwa
bahiirwa / single.php
Last active August 25, 2017 02:00
ADDING AUDIO PLAYER TO HEAVEN’S CORNER PREMIUM TEMPLATE
<div class="post-desc">
<!--Edit Short CODE for the player-->
<?php if($post->post_type == 'sermons') {
$custom_fields = get_post_custom(get_the_ID());
$my_custom_field = $custom_fields['sermon_download'];
foreach ( $my_custom_field as $key => $cck_sermon_link ) {
}?>
<?php if (!empty($cck_sermon_link)) {
$var = apply_filters('the_content', "[embed]" . $cck_sermon_link . "[/embed]");
echo $var;}
@bahiirwa
bahiirwa / page-metabox.php
Created August 25, 2017 11:02 — forked from dingo-d/page-metabox.php
A page metabox with a color picker option
<?php
add_action( 'admin_enqueue_scripts', 'mytheme_backend_scripts');
if ( ! function_exists( 'mytheme_backend_scripts' ) ){
function mytheme_backend_scripts($hook) {
wp_enqueue_media();
wp_enqueue_style( 'wp-color-picker');
wp_enqueue_script( 'wp-color-picker');
}
@bahiirwa
bahiirwa / Woocommerce Archive loop text edits
Created September 5, 2017 02:56
Woocommerce Archive loop text edits
/*Proceed to Checkout*/
remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 );
add_action('woocommerce_proceed_to_checkout', 'sm_woo_custom_checkout_button_text',20);
function sm_woo_custom_checkout_button_text() {
$checkout_url = WC()->cart->get_checkout_url();
?>
<a href="<?php echo $checkout_url; ?>" class="checkout-button button alt wc-forward"><?php _e( 'Check On Out', 'woocommerce' ); ?></a>
<?php
@bahiirwa
bahiirwa / Woocommerce change add to cart text
Created September 9, 2017 12:30
Woocommerce change add to cart text
<?php
add_filter('woocommerce_product_add_to_cart_text', 'wh_archive_custom_cart_button_text'); // 2.1 +
function wh_archive_custom_cart_button_text()
{
return __('Place your order', 'nxgen_ug');
}
@bahiirwa
bahiirwa / Wordpress Query Users based on meta_value
Created September 9, 2017 14:28
Wordpress Query Users based on meta_value
$args = array(
'meta_query' => array(
'relation' => 'AND',
array(
array(
'key' => 'mps_finaldate',
'value' => '',
'compare' => '!='
),
array(
@bahiirwa
bahiirwa / var_dump
Last active September 13, 2017 05:53
var_dump
echo '<pre>';
var_dump($term);
echo '</pre>';
@bahiirwa
bahiirwa / custom Metaboxes OOP
Created October 2, 2017 11:21
Custom Metaboxes OOP
//class custom_metabox
// {
//
// private $cm_name_id;
// private $cm_name;
// private $cpt_name;
//
// function __construct( $cm_name_id, $cm_name, $cpt_name ) {
// $this->cm_name = $cm_name_id;
// $this->cm_name = $cm_name;
@bahiirwa
bahiirwa / Review these
Last active November 15, 2017 02:46
Review these
https://www.ibenic.com/unused-shortcodes-wordpress-code/
@bahiirwa
bahiirwa / YouTube Playlists to follow
Last active November 15, 2017 02:50
YouTube Playlists to follow
Python, Perl, bash and languages
https://www.youtube.com/watch?v=zRwy8gtgJ1A&list=PLillGF-RfqbbbPz6GSEM9hLQObuQjNoj_
https://www.youtube.com/playlist?list=PL_RGaFnxSHWpqRBcStwV0NwMA3nXMh5GC
https://www.youtube.com/watch?v=cQepf9fY6cE&list=PLS1QulWo1RIYmaxcEqw5JhK3b-6rgdWO_
https://www.youtube.com/watch?v=hwrnmQumtPw&list=PLXAjsl8HLYQGq31B5FtfUacT_xbY-SPMB
https://www.youtube.com/playlist?list=PL0-84-yl1fUnRuXGFe_F7qSH1LEnn9LkW
https://www.youtube.com/watch?v=Auo0Ab6oOlo&list=PLillGF-RfqbaQrnidRDPJTx9Z8zazeVEn
https://www.youtube.com/watch?v=2LeqilIw-28&list=PLillGF-RfqbZ7s3t6ZInY3NjEOOX7hsBv
https://www.youtube.com/watch?v=vEROU2XtPR8&list=PLillGF-RfqbbnEGy3ROiLWk7JMCuSyQtX