This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add role class to body | |
function add_role_to_body($classes) { | |
foreach (wp_get_current_user()->roles as $user_role) { | |
$classes[] = 'role-'. $user_role; | |
} | |
return $classes; | |
}); | |
add_filter('body_class','add_role_to_body'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* [list_searcheable_acf list all the custom fields we want to include in our search query] | |
* @return [array] [list of custom fields] | |
*/ | |
function list_searcheable_acf(){ | |
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF"); | |
return $list_searcheable_acf; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Be sure to include library scripts in this order. Can be placed either | |
* in the header or footer. | |
*/ | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.0b2.120519/jquery.infinitescroll.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$location = get_field('map_location'); | |
if ( !empty( $location ) ) : | |
$map_url = 'https://www.google.com/maps/dir/?api=1&destination=' . $location['lat'] . ',' . $location['lng']; | |
echo '<a href=". esc_url( $map_url ) . '" rel="nooopener">Get directions</a>'; | |
endif; | |
?> | |
<p>This should produce a link like this:</p> | |
<a href="https://www.google.com/maps/dir/?api=1&destination=51.072159,1.088130">Get directions</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################## | |
## Example 1 - play a note | |
play 60 | |
############################################## | |
## Example 2 - play 4 random notes | |
4.times do | |
play rrand_i(60, 90) | |
sleep 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# v0.9.0 | |
# Run from Wordpress installation directory | |
# DEFINE COLORS | |
RED='\033[0;31m' # error | |
GRN='\033[0;32m' # success | |
BLU='\033[0;34m' # task | |
BRN='\033[0;33m' # headline | |
NC='\033[0m' # no color |