Skip to content

Instantly share code, notes, and snippets.

@GreggFranklin
GreggFranklin / gist:3733265
Created September 16, 2012 17:09
Still working on it
<?php
/*
Template Name: Home
*/
?>
<?php get_header(); ?>
<aside id="slider_wrap">
<div id="slider_home">
<div class="flexslider">
@GreggFranklin
GreggFranklin / Problem
Created September 16, 2012 15:56
What am I doing wrong?
<aside id="slider_wrap">
<div id="slider_home">
<div class="flexslider">
<ul class="slides">
<?php
$type = 'slider';
$args=array(
'post_type' => $type,
'post_status' => 'publish',
'posts_per_page' => -1,
@GreggFranklin
GreggFranklin / gist:3230404
Created August 1, 2012 20:26
Move Featured Image Metabox
<?php
add_action('do_meta_boxes', 'gf_slider_image_metabox' );
/**
* Move Featured Image Metabox on slider post type
*/
function gf_slider_image_metabox() {
remove_meta_box( 'postimagediv', 'slider', 'side' );
add_meta_box('postimagediv', __('Custom Image'), 'post_thumbnail_meta_box', 'slider', 'normal', 'high');
}
@GreggFranklin
GreggFranklin / dabblet.css
Created December 22, 2011 15:52 — forked from chriscoyier/dabblet.css
Oprah Thing
/* Oprah Thing
Saw some movie and there was some Oprah-related commerical before it and it had title things like this during it
*/
body { background: black; padding: 100px; margin: 0; }
h1 {
text-align: center;
color: white;
text-transform: uppercase;
@GreggFranklin
GreggFranklin / gist:1308124
Created October 24, 2011 00:30
Get Attached Images from Post on Wordpress
<?php function postimage($size=thumbnail, $qty=-1) {
if ( $images = get_children(array(
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => $qty,
'post_mime_type' => 'image',)))
{
foreach( $images as $image ) {
$attachmenturl=wp_get_attachment_url($image->ID);
$attachmentimage=wp_get_attachment_image( $image->ID, $size );