Skip to content

Instantly share code, notes, and snippets.

View melissacabral's full-sized avatar

Melissa Cabral melissacabral

View GitHub Profile
<article class="tile no-image cf graphic-design PUT WORDPRESS POST_CLASS HERE">
<div class="popularity"><a href="#"><i class="icon-heart"></i></a> 9999</div>
<div class="category-icon"> <a href="CATEGORY ARCHIVE"><i class="icon-magic"></i></a> </div>
<h3 class="entry-title"><a href="PERMALINK">TITLE OF RESOURCE</a></h3>
<div class="postmeta">
<span class="username"><a href="#">AUTHOR</a></span> |
<time datetime="2012-02-17" class="time-ago">a long time ago</time>
</div>
</article>
<article class="tile cf graphic-design hentry PUT WORDPRESS POST_CLASS HERE">
<div class="resource-image thumbnail"> <img src="http://placekitten.com/352/198" alt="TITLE"/>
<div class="category-icon"> <i class="icon-magic"></i> </div>
<div class="popularity"><a href="#"><i class="icon-heart"></i></a> 9999</div>
</div>
<h3 class="entry-title">TITLE OF RESOURCE</h3>
<p class="entry-content">Short description of resource</p>
<div class="postmeta">
TAGS
<?php
// A helper function to make generating the HTML for an error message easier
function sticky_field($field){
if(isset($field)){
echo $field;
}
}
function print_error($key, $errors) {
if (isset($errors[$key])) {
<?php
//creates db object
$db = new mysqli('localhost', 'user', 'pass', 'demo');
if($db->connect_errno > 0){
die('Unable to connect to database');
}
//set up query
$query = 'SELECT *
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>HTML5 Starter</title>
<link rel="stylesheet" href="assets/css/main.css" type="text/css" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
@melissacabral
melissacabral / admin-style.css
Last active December 17, 2015 22:49
Admin Panel starter for wp310 blog demo
@charset "utf-8";
@import url(http://fonts.googleapis.com/css?family=Coustard|Droid+Sans:400,700);
/* =RESET */
body,html {
margin: 0;
padding: 0;
height: 100%;
font-size: 100%;
font-family: 'Droid Sans', Arial, Helvetica, sans-serif;
}
@melissacabral
melissacabral / awesome-style.css
Created June 17, 2013 15:59
awesome co style.css
/*
Theme Name: Awesome Co
Theme URI: http://melissacabral.com/
Description: A barebones theme for learning!
Author: melissa cabral
Author URI: http://melissacabral.com
Version: 1.0
License: GPLv2
License URI: license.txt
@melissacabral
melissacabral / template-sitemap.php
Created June 18, 2013 18:00
easy automatic sitemap in wordpress page template
<?php
/*
Template Name: Automagic Sitemap
Will automatically generate a sitemap from the wordpress database of posts, pages, and categories.
*/
?>
<?php get_header(); ?>
<div id="content">
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Pure CSS Dropdowns</title>
<link href="css/reset.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<aside id="complementary">
<?php
//get the titles of the most popular (by number of comments) 5 published posts
$query_popular = 'SELECT posts.title, posts.post_id, COUNT(*) AS numcomments
FROM posts, comments
WHERE posts.is_published = 1
AND posts.post_id = comments.post_id
GROUP BY posts.post_id
ORDER BY numcomments DESC