Skip to content

Instantly share code, notes, and snippets.

View mantismamita's full-sized avatar

Kirsten Cassidy mantismamita

View GitHub Profile
@mantismamita
mantismamita / functions.php
Last active January 2, 2022 09:43
A modified version of the mingleforum class (original code is commented out where code has been modified). functions.php needs option for unsubscribed as each time it is run it subscribes all member players. partial.wpf.class.php automatically subscribes user if player but either doesn't allow him to unsubscribe or he unsubscribes everyone. (not…
// ! mf_forum_subscribers_1 refers to General Forum The league (local)
add_action( 'user_register', 'call_forum_subscribe_member_player' );
function forum_subscribe_member_player()
{
$players= get_users();
foreach($players as $player)
{
@mantismamita
mantismamita / fix.no-js.section.scss
Created October 7, 2013 11:33
This is sort of a quick and dirty fix for zurb foundation issue #2789. Its not very well tested but I thought it might save someone some time.
.no-js{
@media only screen and (min-width: 768px) {
[data-section=''], [data-section='auto'], .section-container.auto {
width: 100%;
position: relative;
display: block;
margin-bottom: 1.25em; }
[data-section='']:not([data-section-resized]):not([data-section-small-style]), [data-section='auto']:not([data-section-resized]):not([data-section-small-style]), .section-container.auto:not([data-section-resized]):not([data-section-small-style]) {
visibility: visible; }
[data-section=''] > section > [data-section-title], [data-section=''] > section > .title, [data-section=''] > .section > [data-section-title], [data-section=''] > .section > .title, [data-section=''] > [data-section-region] > [data-section-title], [data-section=''] > [data-section-region] > .title, [data-section='auto'] > section > [data-section-title], [data-section='auto'] > section > .title, [data-section='auto'] > .section > [data-section-title], [data-section='auto'] > .section > .title, [data-section='auto'] > [data
@mantismamita
mantismamita / jobs-form.php
Last active December 28, 2015 04:59
Front-end Wordpress form with file upload
<?php
/**
* The template used for displaying the jobs form
*
* @package hostel_mama
*/
?>
<?php
if ($_FILES) {
@mantismamita
mantismamita / gist:7619924
Created November 23, 2013 21:02
custom fields for hostel_mama
<?php
// Add-ons
include_once('add-ons/acf-repeater/acf-repeater.php');
include_once('add-ons/acf-gallery/acf-gallery.php');
/**
@mantismamita
mantismamita / gist:8029350
Created December 18, 2013 20:26
Alert for geolocation from desktop
$(document).ready(function(e) {
if(navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)) {
@mantismamita
mantismamita / queries.php
Created February 6, 2014 18:56
Basic form with php validation
<?php
/**
* The template used for displaying the queries form
*
* @package hostel_mama
*/
?>
<?php
$error_query_name = false;
$error_query_email = false;
<?php
/*
* This function outputs HTML for the backend editor.
* The naming convention is: ninja_forms_field_4[custom_value].
* It will be available as $data[custom_value].
*
* $field_id is the id of the field currently being edited.
* $data is an array of the field data, including any custom variables.
*
*/
.ninja-forms-form-wrap .ninja-forms-all-fields-wrap{
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
color: #333333;
label{
font-weight: normal;
}
h2{
display: none;
}
.ninja-forms-required-items{
@mantismamita
mantismamita / new_gist_file_0
Created January 14, 2015 09:05
image replacement
.ir {
font: 0/0 a;
text-shadow: none;
color: transparent;
}
@mantismamita
mantismamita / functions.php
Created March 25, 2015 13:52
Force SSL for media library
function have_https_for_media( $url ) {
if ( is_ssl() )
$url = str_replace( 'http://', 'https://', $url );
return $url;
}
add_filter( 'wp_get_attachment_url', 'have_https_for_media' );