Skip to content

Instantly share code, notes, and snippets.

View szbl's full-sized avatar

Sizeable, Inc. szbl

View GitHub Profile
@szbl
szbl / meta.php
Created July 4, 2013 02:59
Example view from faux MVC WordPress plugin example for CodePoet.com article.
<table class="form-table">
<tbody>
<tr>
<th>
<label for="szbl-person-email">
Email Address:
</label>
</th>
<td>
<input type="email" id="szbl-person-email" name="szbl_person_email" value="<?php
@szbl
szbl / drew-example.php
Last active December 21, 2015 23:48
So Drew doesn't judge me for my dating choices.
<div id="trends">
<?php
$trends_posts = get_posts(array(
'tag_slug__in' => array( 'trends' ),
'posts_per_page' => 1
));
if ( count( $trends_posts ) == 1 ) :
$org_post = $GLOBALS['post'];
<?php
/*
Quickly register lots of sidebars with similar/default code.
*/
$defaults = array(
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
);
<?php
function ramdin_the_content( $content )
{
if ( is_user_logged_in() )
return $content;
if ( 'product' == get_post_type() )
{
$content = 'Please <a href="' . esc_url( site_url( '/wp-login.php' ) ) . '">login to view this product</a>.';
<nav>
<ul id="primary-nav">
<li class="current-menu-item">
<a href="#">Home</a>
</li>
<li>
<a href="">
About
</a>
</li>
<aside id="sidebar">
<!-- Each widget area should be wrapped in the .widget <div> -->
<div class="widget widget-text">
<div id="newsletter">
<h3>Get virtuous news from Brand Virtue!</h3>
<p>Your favoirte brand experts want to give you even more! Receive our monthly eNewsletter in your inbox.</p>
<form method="post" action="#some-mail-chimp-url">
<input type="email" id="email" name="email" placeholder="Your email address">
<!doctype html>
<html>
<head>
<title>Testing</title>
<style type="text/css">
/* Begin Photoshop Copy/Paste */
.Rounded_Rectangle_1 {
border-style: solid;
border-width: 1px;
<div class="vfd-donor-ticker">
<div class="vfd-donor-ticker-wrap">
<ul>
<li>
<span class="name">
Elvis Presley
</span>
<span class="amount red-text">
$200
</span>
<?php
add_shortcode( 'format_test', 'test_shortcode' );
function test_shortcode( $atts )
{
// ignore $atts
return "<div class='test'>This\ntext\n\nshould all appear\n\n\n\non one line if shortcode output is untouched.</div>";
}