Skip to content

Instantly share code, notes, and snippets.

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

Falconerie Badayos II designhash

🏠
Working from home
View GitHub Profile
@designhash
designhash / gist:ef635059c17422953fe925246ba5792c
Created June 25, 2020 07:32
Display Name on assigned week php
// add as much ppeople as you like
$people = array('Ana', 'Bobby', 'Charlie', 'Darren', 'Emma');
// Here you can add holidays
//$holidays = array('2012-07-12', '2012-07-7');
$holidays = array('');
//set start time once
$start = new DateTime('2020-01-06');
@designhash
designhash / singe-ad.php
Created August 16, 2017 01:46
Get Related Random Post Types from Similar Taxonomy
<!-- begin custom related loop, isa -->
<?php
// get the custom post type's taxonomy terms
$custom_taxterms = wp_get_object_terms( $post->ID, 'your_taxonomy', array('fields' => 'ids') );
// arguments
$args = array(
'post_type' => 'your_custom_post_type',
@designhash
designhash / my.cnf
Created July 26, 2017 06:11
How to fix: MySQL not starting on MAMP (Pro)
To fix this, go to MAMP, File > Edit Template > MySQL > [version] and add the line highlighted below.
# The MySQL server
[mysqld]
innodb_force_recovery = 1
The restart the server. After this you can comment out that line. Hopefully you will now be able to run the server again.
@designhash
designhash / keymap.json
Created July 20, 2017 01:00
Tab not working for Emmet in Atom
'atom-text-editor:not([mini])': 'tab': 'emmet:expand-abbreviation-with-tab'
@designhash
designhash / front-page.php
Created July 18, 2017 06:06
Display taxonomy list in Homepage with link, description, image via acf
<?php
$taxonomy = 'type';
$terms = get_terms($taxonomy,array(
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => true
)); ?>
<section id="featured">
<div class="container">
<div class="row">
@designhash
designhash / front-page.php
Last active July 18, 2017 04:19
Show posts from a certain taxonomy
<?php
$loop = new WP_Query(array(
'post_type' => 'ad',
'posts_per_page' => 4,
'tax_query' => array(
// Note: tax_query expects an array of arrays!
array(
'taxonomy' => 'type', // my guess
'field' => 'slug',
'terms' => 'business',
@designhash
designhash / wp-config.php
Created May 24, 2017 03:27
When FTP login displays if you are going to install plugins in WordPress
define('FS_METHOD', 'direct');
@designhash
designhash / functions.php
Created January 31, 2017 02:16
ACF Map Not displaying in Backend
//add this in the functions.php
function my_acf_google_map_api( $api ){
$api['key'] = 'xxx';
return $api;
}
add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
/**
* Include the TGM_Plugin_Activation class.
*/
require_once dirname( __FILE__ ) . '/../class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'my_theme_register_required_plugins' );
/**
* Register the required plugins for this theme.
*
* In this example, we register two plugins - one included with the TGMPA library
@designhash
designhash / functions.php
Last active September 29, 2016 03:31
Remove page title for one single page in Genesis Framework
add_action( 'get_header', 'remove_page_title' );
function remove_page_title() {
if ( is_page( 3 ) ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
}
}