Skip to content

Instantly share code, notes, and snippets.

View melissacabral's full-sized avatar

Melissa Cabral melissacabral

View GitHub Profile
@charset "utf-8";
/* CSS Document */
#rad-slider {
position: relative;
list-style: none;
overflow: hidden;
width: 100%;
padding: 0;
margin: 0;
max-width:1120px;
jQuery(function( $ ){
$("header .genesis-nav-menu").addClass("responsive-menu").before('<div id="responsive-menu-icon-header"></div>');
$(".nav-primary .genesis-nav-menu").addClass("responsive-menu").before('<div id="responsive-menu-icon-nav"></div>');
$("#responsive-menu-icon-header").click(function(){
$("header .genesis-nav-menu").slideToggle();
});
$("#responsive-menu-icon-nav").click(function(){
$(".nav-primary .genesis-nav-menu").slideToggle();
@melissacabral
melissacabral / wp-theme-customization-functions.php
Created February 9, 2015 18:27
theme customization addition for functions
<?php
/**
* Customization API
*/
//add_action( 'customize_register', 'awesome_theme_customizer' );
//
function awesome_theme_customizer( $wp_customize ) {
//Link color
//create the setting and its defaults
$wp_customize->add_setting( 'awesome_link_color', array( 'default' => '#6bcbca', ));
@melissacabral
melissacabral / template-archive-per-term.php
Last active April 26, 2021 16:44
Wordpress template to show one post from each category/taxonomy term
<?php
/*
Template Name: Post thumbnails by taxonomy term
*/
//edit these to match the stuff you registered in your custom post type plugin
$post_type = 'work';
$taxonomy = 'work_category'; ?>
<?php get_header(); ?>
@melissacabral
melissacabral / gist:02c89fa1bab0307dfd2e
Created January 6, 2016 19:03 — forked from engelen/gist:9df926bd9f3957394d89
Use WordPress dashicons in your theme on the frontend.
<?php
add_action( 'wp_enqueue_scripts', 'mytheme_scripts' );
/**
* Enqueue Dashicons style for frontend use
*/
function mytheme_scripts() {
wp_enqueue_style( 'dashicons' );
}
<?php
/*
* Plugin Name: Media Upload Widget
* Plugin URI: http://wordpress.melissacabral.com
* Description: A widget that allows you to upload media from a widget
* Version: 1.0
* Author: Melissa Cabral
* Author URI: http://wordpress.melissacabral.com
* License: GPLv3
*/
@melissacabral
melissacabral / php-debug-to-console.php
Created June 24, 2016 17:03
Helper function to allow PHP to use the console for debugging.
function debug_to_console( $data ) {
if ( is_array( $data ) )
$output = "<script>console.log( 'Debug Objects: " . implode( ',', $data) . "' );</script>";
else
$output = "<script>console.log( 'Debug Objects: " . $data . "' );</script>";
echo $output;
}
<?php
// square cropping logic on lines 56-70
// header has the authentication, DB connection and doctype!
require('admin-header.php');
//begin upload parser
if($_POST['did_upload']){
//the folder where uploads will be saved
$upload_directory = '../uploads';
@melissacabral
melissacabral / comments.php
Last active February 26, 2018 17:21
step 1 of customizing comments display
<?php
//hide all of this file if the post if password protected
if( post_password_required() ){
return;
}
//get a distinct count of comments vs. pings
$comm = get_comments( array(
'status' => 'approve',
'post_id' => $id, //This post