Skip to content

Instantly share code, notes, and snippets.

View dompascal's full-sized avatar

Dominic Pascal dompascal

View GitHub Profile
@dompascal
dompascal / archive-product.php
Created December 5, 2013 19:01
Woocommerce Archive Product Template
<?php
/**
* The Template for displaying product archives, including the main shop page which is a post type archive.
*
* Override this template by copying it to yourtheme/woocommerce/archive-product.php
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/
@dompascal
dompascal / remove-p-tag-from-category-description.php
Created December 5, 2013 16:52
Remove P tag from category description function.
remove_filter('term_description','wpautop');
@dompascal
dompascal / ssh-change-owner-and-group-in-current-folder
Created November 27, 2013 21:57
SSH - Change owner & group of all file in current folder
chown -R username *
chgrp -R group *
@dompascal
dompascal / ssh-tar-to-another-server
Created November 27, 2013 21:24
SSH - TAR to another server
tar zcvf - /folder-to-back-up/ | ssh root@server1.studiopascal.co.uk "cat > /folder-to-back-up-to/backup.tar.gz"
@dompascal
dompascal / wp-mobile-conditionals.php
Created November 23, 2013 12:18
WP - Mobile conditional statements (Uses the mobble wp plugin)
<?php if (is_mobile() ) : ?>
<?php else : ?>
<?php endif; ?>
@dompascal
dompascal / wp-acf-flexible-content-leaderboard-ad.php
Created November 23, 2013 11:11
WP - ACF - Flexible Content - Leaderboard AD
<?php while(has_sub_field('ads','option')): ?>
<?php if(get_row_layout() == '728_x_90_leaderboard'): ?>
<!-- leaderboard AD -->
<span class="leaderboard">
<?php if(get_sub_field('ad_image_728_x_90')) { ?>
<a class="ad" href="<?php the_sub_field('ad_link_728_x_90'); ?>" target="_blank">
<?php $image = wp_get_attachment_image_src(get_sub_field('ad_image_728_x_90'), 'large'); ?>
<img src="<?php echo $image[0]; ?>" alt="" />
</a>
@dompascal
dompascal / social-media-links.html
Created November 23, 2013 11:09
HTML - Social Media Links
@dompascal
dompascal / wp-image-sizes-function
Created November 23, 2013 11:08
WP - Image Sizes Function
if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 600, 50, true ); // Normal post thumbnails
add_image_size( 'thumb',150, 9999 ); // Permalink thumbnail
}
@dompascal
dompascal / wp-footer-template.php
Created November 23, 2013 11:07
WP - Footer Template
@dompascal
dompascal / wp-header-template.php
Created November 23, 2013 11:07
WP - Header Template
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package WordPress
* @subpackage Boilerplate
* @since Boilerplate 1.0
*/