Skip to content

Instantly share code, notes, and snippets.

View jeremyboggs's full-sized avatar

Jeremy Boggs jeremyboggs

View GitHub Profile
@jeremyboggs
jeremyboggs / multigradients.css
Created March 8, 2012 20:32
multiple gradients on one div
div {
width: 500px;
height: 100px;
background-image:
-webkit-linear-gradient(right, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%),
-webkit-linear-gradient(top, rgba(255,200,0,1) 0%,rgba(255,200,0,0) 100%);
}
@jeremyboggs
jeremyboggs / custom-post-metadata-save.php
Created April 2, 2012 22:28
Save custom post metadata in WP
<?php
/**
* Save custom post metadata fields in WordPress.
*/
function my_custom_save_post(){
global $post;
// Populate this array with the names of your fields.
// Should match ID/name attributes in your form.
<?php
$args = array( 'name__like' => "a", 'get' => 'all', 'parent' => 9, 'order' => 'ASC');
$categories = get_terms( 'category', $args );
foreach($categories as $category) {
$categoryImage = new CategoryImagesII();
?>
<?php
$page = (get_query_var('page')) ? get_query_var('page') : 1;
$args = array(
'posts_per_page' => '10',
'cat' => '-592, -614',
'post_status' => 'publish',
'paged=' . $page
);
query_posts($args);
@jeremyboggs
jeremyboggs / add_post_title_class.php
Created April 9, 2012 14:55
Adds post title as a value to WP's body_class and post_class
<?php
function add_post_title_class($classes) {
global $post;
if ($postTitle = sanitize_title($post->post_title)) {
$classes[] = $postTitle;
}
return $classes;
@jeremyboggs
jeremyboggs / custom-item-show.php
Created April 18, 2012 13:24
Set parameters on $_GET to display different metadata on an Omeka's items/show template.
<?php head(array('title' => item('Dublin Core', 'Title'), 'bodyid'=>'items','bodyclass' => 'show')); ?>
<div id="primary">
<!-- Our item view navigation. Sets a parameter on $_GET, so we can change what gets displayed accordingly. -->
<a href="<?php echo abs_item_uri(); ?>?view=transcript">View Transcript</a> | <a href="<?php echo abs_item_uri(); ?>">View Metadata</a>
<h1><?php echo item('Dublin Core', 'Title'); ?></h1>
@jeremyboggs
jeremyboggs / article-header-markup.html
Created April 19, 2012 14:42
Curious what the best way to mark up a heading with a kicker and byline would be. What tags, and in what order.
<header>
<p class="kicker">Latest Post</p>
<h1>Post Title</h1>
<p class="byline"><time datetime="2011-03-25">March 25, 2011</time></p>
</header>
GEM
remote: http://rubygems.org/
specs:
addressable (2.2.7)
chunky_png (1.2.5)
compass (0.12.1)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
compass-susy-plugin (0.9)
@jeremyboggs
jeremyboggs / filter_scholarpress_coins.php
Created May 6, 2012 15:42
Illustrates how to use new filter in ScholarPress Coins plugin
<?php
function my_custom_coins_title($coinsTitle)
{
global $post;
// Starts the coins title value again.
$coinsTitle = 'ctx_ver=Z39.88-2004'
. '&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc'
. '&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator'
@jeremyboggs
jeremyboggs / link_images_to_fullsize.php
Created May 15, 2012 19:44
Change the link around images files in Omeka to point to the fullsize image, not the archival image.