Skip to content

Instantly share code, notes, and snippets.

View tradesouthwest's full-sized avatar
Working remotely

Larry tradesouthwest

Working remotely
View GitHub Profile
@tradesouthwest
tradesouthwest / tevolution-country-template
Created January 16, 2017 16:50
page template trial run for tevolution directory
<?php
/**
* Template Name: Country Listing
*
* This is copy of the search template.
* modified by Codeable @tradesouthwest
* @uses custom_cat type for a country slug
*/
get_header();
do_action( 'before_content' );
@tradesouthwest
tradesouthwest / theme-options_toValuAddTheme.php
Created March 24, 2017 03:28
wordpress settings option defaults keep reappearing
<?php
/**
* Define WTO settings file
*/
function valuadd_settings_file() {
if ( file_exists( VALA_THEME_SETTINGS ) ) {
$theme_settings = VALA_THEME_SETTINGS;
} else {
$theme_settings = VALA_THEME_SETTINGS_VALU;
@tradesouthwest
tradesouthwest / inside-functions.php
Created April 4, 2017 04:32
wp send mail function
<?php
/**
* @Uses wp_mail() to send out email address
* from a single field form.
* Here is the form:
************************************************************************************
<form id="newsletterForm" action="<?php the_permalink(); ?>" method="POST">
<div class="input-group">
<input class="form-control"
placeholder="Email Address"
@tradesouthwest
tradesouthwest / wordcampEUspot.html
Created June 17, 2017 17:40
wordcampEU spotlights pure css
<!DOCTYPE html>
<html lang="en-US" class="no-js no-svg">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>WordCamp Europe 2017 &#8211; June 15-17, Paris, France | #WCEU</title>
This file has been truncated, but you can view the full file.
<IfModule mod_deflate.c>
# Force compression for mangled `Accept-Encoding` request headers
# https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
@tradesouthwest
tradesouthwest / myremoveemjoi_from4_9.php
Created November 17, 2017 18:57
Disable wp 4.9 emojicons function
function my_disable_wp_emojicons() {
// all actions related to emojis
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
<div id="container">
<?php
// simple but effective for string outputting to html page
function esc($s){
return htmlentities(trim($s), ENT_QUOTES, 'UTF-8');
}
function countFolder($dir) {
$get = (count(scandir($dir)) - 2);
if ($get == -2) {
@tradesouthwest
tradesouthwest / image-list.php
Created November 20, 2017 17:55
Visible file in images folder
<?php
session_start();
if (!isset($_SESSION['user_session']))
{
header('Location: ../login.php');
}
?>
<?php
/**
* TSW Listing Nano Directory
@tradesouthwest
tradesouthwest / wp-search-filter-ajax.php
Created January 7, 2018 20:32
wordpress filter for searching categories with ajax
<form action="<?php echo site_url() ?>/wp-admin/admin-ajax.php" method="POST" id="filter">
<?php
if( $terms = get_terms( 'category', 'orderby=name' ) ) :
echo '<select name="categoryfilter"><option>Select category...</option>';
foreach ( $terms as $term ) :
echo '<option value="' . $term->term_id . '">' . $term->name . '</option>';
endforeach;
echo '</select>';
endif;
@tradesouthwest
tradesouthwest / wordness-addons.php
Created February 17, 2018 23:15
Replace WordPress Gravatar Upload
<?php
/**
* Replace default Gravatar with branding logo.
*/
function wordness_new_default_gravatar($avatar_defaults)
{
//be safe default
$def = esc_url( plugin_dir_url( dirname(__FILE__) )
. 'css/poplogin-default-logo.png' );