Skip to content

Instantly share code, notes, and snippets.

View mrtwebdesign's full-sized avatar
💭
I may be slow to respond.

Matthew Taylor mrtwebdesign

💭
I may be slow to respond.
View GitHub Profile
<?php
/* Template Name: games dynamic */
global $avia_config;
/*
* get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
*/
get_header();
if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title();
$loading_gif_url = home_url().'/wp-content/uploads/2016/08/loading.gif';
<?php
/* Template Name: games dynamic */
global $avia_config;
/*
* get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
*/
get_header();
if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title();
?>
<div class='container_wrap container_wrap_first main_color shop_columns_3 <?php avia_layout_class( 'main' ); ?>'>
@mrtwebdesign
mrtwebdesign / WP Allow Duplicate Comments
Created February 28, 2014 04:33
Remove duplicate comment restriction. Useful when you really do need to repeat yourself on a regular basis.
add_action( 'preprocess_comment' , 'preprocess_comment_handler' );
$rf_success = remove_filter('commentdata','comment_duplicate_trigger');
if (!$rf_success) {
write_log ('remove duplicate comment filter failed');
}
@mrtwebdesign
mrtwebdesign / filetracker template parts functions.php
Created December 30, 2013 08:12
function to display all of the files used in creating the page for WordPress theme
function filetracker(){
$included_files = get_included_files();
$stylesheet_dir = str_replace( '\\', '/', get_stylesheet_directory() );
$template_dir = str_replace( '\\', '/', get_template_directory() );
foreach ( $included_files as $key => $path ) {
$path = '<br>'.str_replace( '\\', '/', $path );
if ( false === strpos( $path, $stylesheet_dir ) && false === strpos( $path, $template_dir ) )
@mrtwebdesign
mrtwebdesign / debug true log only wp-config.php
Created December 30, 2013 07:51
Turn on debugging without displaying it on the web pages. Errors are written to a log file in wp-content.
// Enable WP_DEBUG mode
define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);
@mrtwebdesign
mrtwebdesign / index.html
Created June 13, 2013 19:56
A CodePen by Matthew Taylor.
<div class="outerwrap">
<div class="boxcontent">
<div class="overlay clearfix">
overlay text
</div>
</div>
</div>
<div class="outerwrap">
<div class="boxcontent">
<div class="overlay clearfix">
@mrtwebdesign
mrtwebdesign / wp_key_val
Created July 22, 2012 12:39
WP output key value pair of custom field
<?php if ( get_post_meta($post->ID, '$key', true) ) : ?>
<div id="key" class="class">
<div class="key-label">Label:</div>
<div class="key-value">
<?php echo get_post_meta($post->ID, 'CustomFieldLabel', true); ?>
</div>
</div>
<?php endif; ?>