Skip to content

Instantly share code, notes, and snippets.

View dwainm's full-sized avatar
💸
WooCommerce Payments https://woocommerce.com/payments/

Dwain Maralack dwainm

💸
WooCommerce Payments https://woocommerce.com/payments/
View GitHub Profile
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
add_filter( 'comment_form_default_fields', 'woo_custom_comment_form_fields', 20 );
function woo_custom_comment_form_fields ( $fields ) {
$commenter = wp_get_current_commenter();
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
$fields = array(
@dwainm
dwainm / header-part.php
Created February 11, 2013 15:57
Show logo in Canvas
<div id="logo">
<?php
// Website heading/logo and description text.
if ( isset( $woo_options['woo_logo'] ) && ( '' != $woo_options['woo_logo'] ) ) {
$logo_url = $woo_options['woo_logo'];
if ( is_ssl() ) $logo_url = str_replace( 'http://', 'https://', $logo_url );
echo '<a href="' . esc_url( $site_url ) . '" title="' . esc_attr( $site_description ) . '"><img src="' . esc_url( $logo_url ) . '" alt="' . esc_attr( $site_title ) . '" /></a>' . "\n";
} // End IF Statement
@dwainm
dwainm / star.css
Created February 14, 2013 08:45
star css for woothemes
.star-rating{float:right;width:80px;height:16px;background:url(../images/star.png) repeat-x left 0}
.star-rating span{background:url(../images/star.png) repeat-x left -32px;height:0;padding-top:16px;overflow:hidden;float:left}
.hreview-aggregate .star-rating{margin:10px 0 0 0}
#review_form #respond{position:static;margin:0;width:auto;padding:0 0 0;background:transparent none;border:0}
#review_form #respond:after{content:"";display:block;clear:both}
#review_form #respond p{margin:0 0 10px}
#review_form #respond .form-submit input{left:auto}
#review_form #respond textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%}
p.stars:after{content:"";display:block;clear:both}
p.stars span{width:80px;height:16px;position:relative;float:left;background:url(../images/star.png) repeat-x left 0}
@dwainm
dwainm / content.php
Last active December 13, 2015 18:08
capital content.php
<?php
/**
* The default template for displaying content
*/
global $woo_options;
/**
* The Variables
*
@dwainm
dwainm / template-blog.php
Created February 14, 2013 15:54
capital template blog
<?php
/**
* Template Name: Blog
*
* The blog page template displays the "blog-style" template on a sub-page.
*
* @package WooFramework
* @subpackage Template
*/
@dwainm
dwainm / content-post.php
Created February 19, 2013 12:30
canvas-content.php
<?php
/**
* Post Content Template
*
* This template is the default page content template. It is used to display the content of the
* `single.php` template file, contextually, as well as in archive lists or search results.
*
* @package WooFramework
* @subpackage Template
*/
@dwainm
dwainm / functions
Created February 19, 2013 17:48
exclude category from canvas home page
// Exclude categories on the homepage.
add_filter( 'pre_get_posts', 'custom_exclude_categories_homepage', 10 );
function custom_exclude_categories_homepage ( $query ) {
if($query->is_home()){
$excluded_cats = array(45);
$query->set( 'category__not_in', $excluded_cats );
$query->parse_query();
}
@dwainm
dwainm / comments.php
Created February 21, 2013 14:56
comments.php
<?php
// Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if ( post_password_required() ) { ?>
<p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.', 'woothemes') ?></p>
@dwainm
dwainm / index.php
Created February 26, 2013 11:09
index.php for one pager
<?php
// File Security Check
if ( ! function_exists( 'wp' ) && ! empty( $_SERVER['SCRIPT_FILENAME'] ) && basename( __FILE__ ) == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
die ( 'You do not have sufficient permissions to access this page!' );
}
?><?php
/**
* Index Template
*
* Here we setup all logic and XHTML that is required for the index template, used as both the homepage