Skip to content

Instantly share code, notes, and snippets.

@stegel
stegel / custom-hooks.php
Last active September 10, 2018 22:07
Custom Hook for refresh on sort
add_action('wp_head', 'fwp_refresh_on_sort');
function fwp_refresh_on_sort() {
?>
<script type="text/javascript">
//<![CDATA[
(function($) {
$(document).ready(function() {
$('.facetwp-sort').on('change','select', function() {
console.log("hey");
@stegel
stegel / gist:dcab78a878eaec3412ffda149cbcbf65
Created September 10, 2018 19:57
responsive-threats.php
<div id="results" class="asd-results">
<?php while ( have_posts() ): the_post(); ?>
<div class="asd-result">
<?php if ( has_post_thumbnail() ) : ?>
<div class="asd-result__thumb">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail("medium") ?></a>
</div>
<?php endif ?>
<div class="asd-result__content">
<h3 class="asd-result__title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php
/**
* The search-form template.
*
* @package Avada
* @subpackage Templates
*/
// Do not allow directly accessing this file.
if ( ! defined( 'ABSPATH' ) ) {
@stegel
stegel / facetwp-time-since.php
Created April 25, 2018 01:19
ASD Time Since fixed as drop down
<?php
/*
Plugin Name: ASD FacetWP - ASD Time Since
Description: "ASD Time Since" facet
Version: 1.0
Based on: 1.4.2
Author: AJ Siegel
Original Author URI: https://facetwp.com/
Original GitHub URI: facetwp/facetwp-time-since
*/
@stegel
stegel / mapbox.php
Created April 25, 2018 01:18
mapbox header template for Avada child
<?php
$interactive = (is_page("home")) ? 0 : true;
$features = [];
$args = array(
"post_type" => 'asd_operation',
"facetwp" => false
);
@stegel
stegel / facetwp-time-since.php
Created April 24, 2018 01:20
FacetWP Time Since as Dropdown
<?php
/*
Plugin Name: ASD FacetWP - ASD Time Since
Description: "ASD Time Since" facet
Version: 1.0
Based on: 1.4.2
Author: AJ Siegel
Original Author URI: https://facetwp.com/
Original GitHub URI: facetwp/facetwp-time-since
*/
@stegel
stegel / token.xhtml
Created March 22, 2016 21:11
How to get session token on a ui page with direct=true
<!--- In a ui page -->
<!-- this will get the token on the server side and set it to a client-side javascript variable.
<g:evaluate object="true">
var g_ck = gs.getSessionToken();
</g:evaluate>
<script>
window.g_ck = "$[g_ck]";
</script>
<!-- In your AngularJS config, you can set the token as a default $httpProvider header -->
@stegel
stegel / development.rb
Created April 25, 2012 18:46
Unable to connect to SES
config.after_initialize do
ActionMailer::Base.delivery_method = :amazon_ses
ActionMailer::Base.custom_amazon_ses_mailer = AWS::SES::Base.new(:secret_access_key => 'abc', :access_key_id => ''123')
end