Skip to content

Instantly share code, notes, and snippets.

View teolopez's full-sized avatar
🤓

Teodoro Lopez teolopez

🤓
View GitHub Profile
@teolopez
teolopez / custom_post_type_template.php
Last active March 10, 2022 07:54
Plugin -- Template to create Custom Post Type
<?php
/**
* Teo Lopez Wordpress Plugin Boilerplate
* Built from: The WordPress Plugin Boilerplate.
*
* A foundation off of which to build well-documented WordPress plugins that
* also follow WordPress Coding Standards and PHP best practices.
*
* @package
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public
@teolopez
teolopez / fgetcsv-01
Last active April 26, 2022 02:24
fgetcsv – csv to html table
<table class="table table-bordered table-condensed table-hover">
<?php
$row = 1;
ini_set('auto_detect_line_endings',TRUE);
if (($handle = fopen("http://docs.shopify.com/manual/your-store/products/product_template.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
echo "<tr>";
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_team-rosters',
'title' => 'Team Rosters',
'fields' => array (
array (
'key' => 'field_537e71196bd9b',
'label' => 'Coach Roster',
'name' => '',
@teolopez
teolopez / 0_reuse_code.js
Created June 30, 2014 23:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/**
*
* Generate Multiple Pages – Child Pages
*
**/
$boysTeams = array(
'Basketball',
'Baseball',
@teolopez
teolopez / gist:11387553
Created April 29, 2014 00:05
OUHSD – new post type
/* Replace superintendent */
add_action( 'init', 'codex_superintendent_init' );
/**
* Register a superintendent post type.
*
* @link http://codex.wordpress.org/Function_Reference/register_post_type
*/
function codex_superintendent_init() {
$labels = array(
@teolopez
teolopez / list style
Last active August 29, 2015 13:56
victor check this out
$('.bxslider').bxSlider({
auto: true,
autoDirection: 'prev',
});

Contract Killer

  • Revised date: 02/12/2014

Between us [company name] and you [customer name]

@teolopez
teolopez / gist:8495783
Created January 18, 2014 20:26
registration fields - gza grid 02
<div class="control-group">
<label class="control-label" for="inputEmail">LinkedIn URL</label>
<div class="controls">
<input type="text" name="linkedin" id="linkedin" class="input-medium" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputEmail">Twitter</label>
<div class="controls">
<div class="input-prepend">