Skip to content

Instantly share code, notes, and snippets.

View celticwebdesign's full-sized avatar

Darren Stevens celticwebdesign

View GitHub Profile
<body
<?php
if( is_singular('things_to_do') ) {
// allows us to add taxonomy term to body class
$things_to_do_queried_object = get_queried_object();
$terms = get_the_terms( $things_to_do_queried_object->ID, 'things_to_do_type' );
if ( $terms && ! is_wp_error( $terms ) ) :
$draught_links = array();
category.php
<?php
$homepg=get_bloginfo('url')."/news-notices/news/";
header("Location: $homepg",TRUE,301);
// http://websistent.com/redirect-wordpress-archives/
// Redirect unused category page to news page.
?>
// http://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-wordpress-widget/
//
// Select a Restaurant
class eoc_widget_select_restaurant extends WP_Widget {
function __construct() {
parent::__construct(
// Base ID of your widget
'eoc_widget_select_restaurant',
# initializr
# ######################################################################
# # WEB PERFORMANCE #
# ######################################################################
# ----------------------------------------------------------------------
# | Compression |
# ----------------------------------------------------------------------
query_posts( $query_string . '&posts_per_page=-1' );
if (have_posts()): while (have_posts()) : the_post(); ?>
http://snipplr.com/view.php?codeview&id=70656
# First:
DELETE FROM wp_postmeta
WHERE post_id IN
(
SELECT id
FROM wp_posts
WHERE post_type = 'attachment'
<?php
// // WordPress method - Start
// function get_json( $url, $arg ) {
// //GET remote site
// $response = wp_remote_get( $url, $arg );
// //Checking for errors
// if ( is_wp_error( $response ) ) {
// return sprintf( 'Your URL %1s could not be retrieved', $url );
$("img.lazy").lazyload({
effect : "fadeIn",
threshold : 200,
event : "sporty"
});
$('#order_az').click(function() {
$("img.lazy").trigger('sporty');
});
add_meta_box('nme_pro_reviews_box', 'Property Reviews', 'nme_pro_reviews_box', 'property', 'normal', 'high');