Skip to content

Instantly share code, notes, and snippets.

View melissacabral's full-sized avatar

Melissa Cabral melissacabral

View GitHub Profile
@melissacabral
melissacabral / Comment Callback Function
Last active October 12, 2015 13:18
control what each comment looks like when wp_list_comments() runs. place in functions.php
/**
* Comments.php callback function
*/
//this will control what each comment looks like when wp_list_comments() runs.
function awesome_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
if ( 'div' == $args['style'] ) {
$tag = 'div';
@melissacabral
melissacabral / wp-dimox-breadcrumbs.php
Last active February 17, 2022 09:13
breadcrumbs - place in functions.php and call in your theme with dimox_breadcrumbs() [Source](http://dimox.net/wordpress-breadcrumbs-without-a-plugin/)
<?php
/**
* Dimox Breadcrumbs
* http://dimox.net/wordpress-breadcrumbs-without-a-plugin/
* Since ver 1.0
* Add this to any template file by calling dimox_breadcrumbs()
* Changes: MC added taxonomy support
*/
function dimox_breadcrumbs(){
/* === OPTIONS === */
@melissacabral
melissacabral / wordpress loop
Created November 7, 2012 16:59 — forked from monoooki/wordpress loop
wordpress loop desu.
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
@melissacabral
melissacabral / wordpress loop
Created November 7, 2012 17:01
Basic wordpress loop
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- template tags and HTML go here, like this: -->
<h2><?php the_title(); ?></h2>
<?php endwhile; else:?>
<h2>Sorry, no posts found</h2>
<?php endif; ?>
@melissacabral
melissacabral / CPT Products CSS
Created November 8, 2012 18:44
Custom Post Type Products CSS additions
/*
== custom post type - PRODUCTS
*/
.archive-title{
margin:20px 47px;
font-size:30px;
text-align:center;
color:#CCC;
border-top: double 1px #EEE;
border-bottom: double 1px #EEE;
@melissacabral
melissacabral / HTML5 starter.html
Last active October 12, 2015 14:47
Simple HTML5 starting point for day 2 demo
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<meta name="description" content="DESCRIPTION" />
<title>SITE NAME - SITE DESCRIPTION</title>
<link rel="stylesheet" href="RESET_STYLESHEET_URL" media="screen" />
<link rel="stylesheet" href="STYLESHEET_URI" media="screen" />
</head>
@melissacabral
melissacabral / wp-widget.php
Last active January 20, 2016 16:35
Widget API - Basic Setup. Use in a plugin or functions file
<?php
function rad_register_widget(){
register_widget('Rad_Simple_Widget');
}
add_action('widgets_init', 'rad_register_widget');
//our new widget is a copy of the WP_Widget object class
class Rad_Simple_Widget extends WP_Widget{
function __construct(){
@melissacabral
melissacabral / widget-thumbs-css
Last active October 13, 2015 00:38
Day 17 - Widget stylesheet
/*
stylesheet for recent posts plugin with thumbnails
*/
.products-widget img {
margin:0 0 10px 0;
}
.products-widget .readmore {
display:none;
}
@melissacabral
melissacabral / wordpress_css_comment.css
Created November 30, 2012 16:39 — forked from leanda/wordpress_css_comment.css
WordPress: style sheet comment block
/*
Theme Name: Twenty Ten
Theme URI: http://wordpress.org/
Description: The 2010 default theme for WordPress.
Author: wordpressdotorg
Author URI: http://wordpress.org/
Version: 1.0
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu (optional)
License:
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,