Skip to content

Instantly share code, notes, and snippets.

View media317's full-sized avatar

Alan Smith media317

View GitHub Profile
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>get_title</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="childtheme/style.css">
<link rel="shortcut icon" href="childtheme/images/favicon.ico">
@media317
media317 / gist:4632494
Created January 25, 2013 07:27
Genesis 1.9.1 Loop. Not working???!!
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_before_loop', 'child_maybe_do_grid_loop' );
function child_maybe_do_grid_loop() {
// Amend this conditional to pick where this grid looping occurs
if ( is_page('bbtestpage') ) {
remove_action('genesis_before_post_content', 'genesis_post_info');
@media317
media317 / Custom Stylesheet TinyMCE
Created February 7, 2013 18:24
Custom style sheet for the TinyMCE Visual Editor in Wordpress
/** Add Editor Styles within a WP Child theme*/
add_editor_style(); //This will use the default styles of your child theme stylesheet.
/** Add Editor Styles for WP Themes */
add_editor_style( 'custom-editor-style.css' );
@media317
media317 / gist:5085350
Last active December 14, 2015 12:18
Add custom Avatar to WordPress install.
// Add a default avatar to Settings > Discussion
if ( !function_exists('media317_addgravatar') ) {
function media317_addgravatar( $avatar_defaults ) {
$myavatar = get_bloginfo('stylesheet_directory') . '/images/avatar.jpg'; // Make sure to add the images directory to theme
$avatar_defaults[$myavatar] = 'Media317'; //Add a default name for the Avatar
return $avatar_defaults;
}
add_filter( 'avatar_defaults', 'fb_addgravatar' );
<?php
/**
* The custom Projects post type single post template
*/
/** Remove standard Genesis Loop */
remove_action( 'genesis_loop' , 'genesis_do_loop' );
/** Add custom loop for Portfolio page */
add_action( 'genesis_loop', 'me_portfolio' );
I cannot seem to get this to work... I'm on Genesis 1.9.2
My CPT Projects has several metaboxes. I have four image/file upload metaboxes. I am using the following for the boxes:
array(
'name' => 'Main Project Image',
'desc' => 'Upload an image or enter an URL for the Main Image',
'id' => $prefix . '_main_project_img',
'type' => 'file',
'save_id' => true, // save ID using true
@media317
media317 / WP Image Size to Media Selection
Last active December 17, 2015 11:38
Add Image Sizes to Media Selection
//** Add image sizes to Media Selection */
add_filter('image_size_names_choose', 'me_display_image_size_names_muploader', 11, 1);
function me_display_image_size_names_muploader( $sizes ) {
$new_sizes = array();
$added_sizes = get_intermediate_image_sizes();
// $added_sizes is an indexed array, therefore need to convert it
// to associative array, using $value for $key and $value
/** Add new image sizes */
// ( 'name', width, height, crop)
add_image_size( 'Featured', 1040, 400, TRUE );
/** Add Project Information After Content */
add_action ( 'genesis_sidebar', 'mmi_sing_project_side' );
function mmi_sing_project_side() {
global $wp_query;
$participants = $wp_query->post->ID;
echo '<div class="mmi-sidebar">';
echo '<section class="widget">';
echo '<h4 class="widgettitle">Participate In This Project</h4>';
@media317
media317 / responsive video div
Created September 18, 2013 23:39
Create a Responsive video player div
#mediaspace_wrapper {
position: relative;
height: 0;
padding-bottom: 59%;
padding-top: 0;
}