Skip to content

Instantly share code, notes, and snippets.

View ChrisFlannagan's full-sized avatar

Chris Flannagan ChrisFlannagan

View GitHub Profile
.footermenu-list {
display: inline-block;
padding: 0;
> .listitem {
list-style-type: none;
padding: 5px;
> .link {
color: Green;
text-decoration: none;
}
<ul class=”footermenu-list”>
<li class=”listitem”>
<a href=”#” class=”link”>Home</a>
</li>
<li class=”listitem -active”>
<a href=”#” class=”link”>Blog</a>
</li>
<li class=”listitem”>
<a href=”#” class=”link”>Contact</a>
</li>
<?php
/**
* This array of data could be stored in it's own file to be included. Could be in /inc/data or something like that.
* Helps keep your code WAY cleaner and more organized
*/
$polygons = array(
'projecting_sign_link' => array(
'classes' => 'map-hover map-projecting tooltip',
'tooltip' => 'projecting_sign_tooltip',
'points' => '1257.0 256.19 1257.03',
[bm_section][bm_owl_slider class="top_hero owl-theme" height="410px" slide="2" timeout="10000" start="true" max_height="410px" min_height="410px" aspect=".4"]
[bm_owl_slide background="/wp-content/uploads/2017/05/sc-hero.png" padtop="40px"]
<h4 style="text-align: center; padding-top: 30px;"></h4>
<h4 style="text-align: center; padding-top: 30px;"></h4>
<h4 style="text-align: center; padding-top: 30px;"></h4>
&nbsp;
<h4 style="text-align: center; padding-top: 30px;"><a class="orange" style="margin-top: 20px !important;" href="https://www.xactlycorp.com/simplycomp/">LEARN MORE</a></h4>
[/bm_owl_slide]
<?php
/**
* written by Chris Flannagan
*
* SUPER QUICK PROOF OF CONCEPT
*
* The coding practices here are UNACCEPTABLE but use for snippets or to rewrite into a proper plugin if you'd like
*
* Find more stuff at https://whoischris.com
<?php // returns a 1 for some reason ?>
<input type="text" name="your-name" id="your-name" value="<?php
// Escape and fill in value with submitted form value if returned
echo esc_attr( isset( $_GET['your-name'] ) ?? '' ); ?>" />
<?php
$args = array(
'post_type' => 'post',
'date_query' => array(
array(
'after' => array(
'year' => $past['year'],
'month' => $past['mon'],
'day' => $past['mday'],
),
@ChrisFlannagan
ChrisFlannagan / functions.php
Created May 5, 2017 01:02
Adding this to your functions.php file or anywhere else will add rewrite rules for multiple taxonomies and terms
<?php
add_action( 'init', function() {
// Taxonomy rewrite for resources
if ( strpos( $_SERVER['REQUEST_URI'], '/resource/' ) === 0 ) {
$uri = explode( '/', $_SERVER['REQUEST_URI'] );
$t = get_term_by( 'slug', $uri[3], 'resource-type' );
$t_id = $t->term_id;
add_rewrite_rule( '^resource/([^/]+)/([^/]+)/?$', 'index.php?resource-type-bucket=$matches[1]&t=' . $t_id, 'top' );
add_rewrite_tag( '%t%', '([^&]+)' );
if ( ! get_option( $uri[2] . '/' . $uri[3] ) ) {
<?php
/**
* This works just fine but it's probably a terrible way of doing it
**/
if ( strpos( $_SERVER['REQUEST_URI'], '/resource/' ) === 0 ) {
$uri = explode( '/', $_SERVER['REQUEST_URI'] );
$t = get_term_by( 'slug', $uri[3], FP_SITE_PREFIX . '-resource-type' );
$t_id = $t->term_id;
add_rewrite_rule('^resource/([^/]+)/([^/]+)/?$', 'index.php?' . FP_SITE_PREFIX . '-resource-type-bucket=$matches[1]&t=' . $t_id, 'top');
<?php
/**
* Plugin Name: Give - Free
**/
/**
* Register our plugin so it shows up as an option in the Give gateway settings
*/
add_filter( 'give_payment_gateways', function() {
// Here replace 'give_free' with a unique slug for your plugin. You will use this slug throughout this plugin.