Skip to content

Instantly share code, notes, and snippets.

View szbl's full-sized avatar

Sizeable, Inc. szbl

View GitHub Profile
@szbl
szbl / ryan.php
Last active August 29, 2015 14:06
<?php
$obj = new stdClass();
echo 'Object in var: ';
var_dump( $obj == true );
echo '<hr>';
echo 'Non-existent var: ';
@var_dump( $nonexistent_obj == true );
<?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>";
}
<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>
<!doctype html>
<html>
<head>
<title>Testing</title>
<style type="text/css">
/* Begin Photoshop Copy/Paste */
.Rounded_Rectangle_1 {
border-style: solid;
border-width: 1px;
<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">
<nav>
<ul id="primary-nav">
<li class="current-menu-item">
<a href="#">Home</a>
</li>
<li>
<a href="">
About
</a>
</li>
<?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>.';
<?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>'
);
@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'];