Skip to content

Instantly share code, notes, and snippets.

@danielbrinneman
danielbrinneman / functions.php
Created November 8, 2025 04:57
How to sort posts within a taxonomy by a custom field value (2014)
<?php $args = array( //How to sort posts within a taxonomy by a custom field value
'post_type' => 'membersbooks',
'taxonomy' => 'genres',
'posts_per_page' => -1,
'post_status' => 'publish',
'meta_key' => 'mb-authorlastname',
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_query' => array(
@danielbrinneman
danielbrinneman / script.js
Created November 8, 2025 04:55
Google Maps API v3 - Map by LatLng - WordPress CPT (2014)
map.js file@h@
var map;
var infowindow = new google.maps.InfoWindow();
var pinkmarker = new google.maps.MarkerImage('/t3X5Sw3ST1nG0NS2LiNG7RJu1cE6WP/wp-content/themes/TMA2013SeptDB/_/locationsCPTMap/pmark.png', new google.maps.Size(20, 34) );
var shadow = new google.maps.MarkerImage('/t3X5Sw3ST1nG0NS2LiNG7RJu1cE6WP/wp-content/themes/TMA2013SeptDB/_/locationsCPTMap/shadow.png', new google.maps.Size(37, 34) );
function initialize() {
map = new google.maps.Map(document.getElementById('map'), {
@danielbrinneman
danielbrinneman / functions.php
Created November 8, 2025 04:54
WordPress Genesis Framework Custom Post Meta itemprop (2014)
// Customize the post meta function, custom output shows one category and itemprop is applied to it (took me a long time to figure this one out)
add_filter( 'genesis_post_meta', 'kgdb_post_meta_filter' );
function kgdb_post_meta_filter() {
global $post;
$itemprop = 'itemprop="recipeType"';
$category = get_the_category();
if ( 'post' == get_post_type() && in_category( array( 4, 5, 6, 12, 15, 16, 32 ) ) ) {
echo '<p class="entry-meta"><span class="entry-categories">Filed Under: ';
echo '<a href="'.get_category_link($category[0]->term_id ).'" ' . $itemprop . '>'.$category[0]->cat_name.'</a></span></p>';
@danielbrinneman
danielbrinneman / styles.css
Created November 8, 2025 04:53
Kimchi Belles - Google Search box in sidebar (2013)
.cse .gsc-search-button input.gsc-search-button-v2, input.gsc-search-button-v2 {
width: 13px;
height: 25px;
padding: 6px 27px;
min-width: 13px;
margin-top: -3px;
vertical-align: middle;
}
input, select, textarea {
@danielbrinneman
danielbrinneman / index.html
Created November 8, 2025 04:51
Signup MailChimp Form for eBook and text to edit (2013)
<!-- Create form code in MailChimp so the Signup Thank you Form, redirect link, can be set, then place that code in the action property of <form> and button needs to be Subscribe value -->
<div class="bookPDFouter">
<div class="bookPDFinner">
<img src="wp-content/themes/rich/img/AHFH4-eBook.png" alt="AHFH4-eBook" width="103" height="199" class="alignleft" />
<h1>FREE New Richard London ebook</h1>
<h2>A Handbook for Happiness</h2>
<p>Happiness is a Decision!<br /><br />What can you do to help yourself be happy in the face of life’s pressures and challenges?</p>
<p style="font-size:8px; text-align:right; margin-top:1em;">Give us your email address and download now!</p>
@danielbrinneman
danielbrinneman / script.js
Created November 8, 2025 04:50
FlowPlayer Cross Browser/Platform Video Embed (2012)
Place in Page/Post editor and provide three video files (MP4 first always, WebM, OGV, Flash last) / Video tag needs both to work. id="video" AND onclick="playOrPause();"
<!-- "Video For Everybody" http://camendesign.com/code/video_for_everybody -->
<video controls poster="http://metropolitan-ballroom.com/wp-content/themes/metro/video/owners-preview.jpg" width="640" height="360" id="video" onclick="playOrPause();">
<source src="http://metropolitan-ballroom.com/wp-content/themes/metro/video/ownersIntro.mp4" type="video/mp4">
<source src="http://metropolitan-ballroom.com/wp-content/themes/metro/video/ownersIntro.webmsd.webm" type="video/webm">
<source src="http://metropolitan-ballroom.com/wp-content/themes/metro/video/ownersIntro.oggtheora.ogv" type="video/ogg">
<object type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" width="640" height="360">
<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf">
<param name="allowFul
@danielbrinneman
danielbrinneman / gallery.php
Created November 8, 2025 04:49
Custom WordPress Gallery Design for Shortcode (2012)
@danielbrinneman
danielbrinneman / index.php
Created November 8, 2025 04:48
Custom Horizontal Social Share Bar (2012)
CSS
/******** Blog and Single Post Share - uses socialshareicons folder in img folder *********/
/*Code by Daniel Brinneman, Sept 14, 2012 */
#customFloatingShareBar {
position:relative;
padding: 5px auto;
@danielbrinneman
danielbrinneman / index.js
Created November 8, 2025 04:46
PayPal form - Increment items - jQuery - WordPress sidebar (2012)
HTML - single file in theme
<!DOCTYPE html />
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset="UTF-8" />
</head>
<body>
<base target="_blank" />
@danielbrinneman
danielbrinneman / functions.php
Created November 8, 2025 04:44
Enable Thickbox in WordPress (2012)
Functions.php
//Enable Thickbox
add_action('init', 'init_theme_method');
function init_theme_method() {
add_thickbox();