This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_categories('child_of=92&hide_empty=false&orderby=meta_value&meta_key=date&order=ASC'); | |
//----------------------------------------------------------------------- | |
function category_custom_field_get_terms_orderby( $orderby, $args ){ | |
if($args['orderby'] == 'category_custom_field' && isset($args['category_custom_field'])) | |
return 'cv.field_value'; | |
return $orderby; | |
} | |
function category_custom_field_get_terms_fields( $selects, $args ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (is_category()) { | |
$this_category = get_category($cat); | |
if (get_category_children($this_category->cat_ID) != "") { | |
echo "<h1>Subcategories</h1>"; | |
echo "<ul>"; | |
wp_list_categories('orderby=id&show_count=0&title_li= | |
&use_desc_for_title=1&child_of='.$this_category->cat_ID); | |
echo "</ul>"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mail_from() { | |
$emailaddress = 'contact@1stwebdesigner.com'; | |
return $emailaddress; | |
} | |
function mail_from_name() { | |
$sendername = "1stWebDesigner.com - Dainis"; | |
return $sendername; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pm_remove_all_scripts() { | |
global $wp_scripts; | |
$wp_scripts->queue = array(); | |
} | |
add_action('wp_print_scripts', 'pm_remove_all_scripts', 100); | |
function pm_remove_all_styles() { | |
global $wp_styles; | |
$wp_styles->queue = array(); | |
} | |
add_action('wp_print_styles', 'pm_remove_all_styles', 100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VK.init({apiId:"...", onlyWidgets: false}); | |
VK.Api.call('likes.getList', {type: "sitepage", owner_id: "...[apiId]",page_url:pageuri}, | |
function(r) { | |
if(r.response && r.response.count) { | |
$.getJSON('...?rating=vk&ratingvalue=' + r.response.count); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.getJSON('https://graph.facebook.com/fql?q=select like_count, share_count from link_stat where url="' + encodeURI(page_url) + '"' | |
+ '&callback=?', function(response) { | |
var count = 0; | |
if (response.data !== undefined) { | |
if (response.data[0].like_count !== undefined) { | |
count += response.data[0].like_count; | |
} | |
if (response.data[0].share_count !== undefined) { | |
count += response.data[0].share_count; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
[...] | |
set $cache_uri $request_uri; | |
# POST requests and urls with a query string should always go to PHP | |
if ($request_method = POST) { | |
set $cache_uri 'null cache'; | |
} | |
if ($query_string != "") { | |
set $cache_uri 'null cache'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 127.0.0.1:80; | |
server_name nocache.domain.tld; | |
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|swf|txt|ico)$ { | |
allow 127.0.0.1; | |
deny all; | |
root /path/to/fuse/filesystem; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'phpmailer_init', 'wpse8170_phpmailer_init' ); | |
function wpse8170_phpmailer_init( PHPMailer $phpmailer ) { | |
$phpmailer->Host = 'your.smtp.server.here'; | |
$phpmailer->Port = 25; // could be different | |
$phpmailer->Username = 'your_username@example.com'; // if required | |
$phpmailer->Password = 'yourpassword'; // if required | |
$phpmailer->SMTPAuth = true; // if required | |
// $phpmailer->SMTPSecure = 'ssl'; // enable if required, 'tls' is another possible value | |
$phpmailer->IsSMTP(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
block : 'page', | |
title : 'grid', | |
head : [ | |
{elem: 'css', url: '_grid.css'} | |
], | |
scripts: [{elem: 'js', url: '_grid.js'}], | |
content: [ | |
{ | |
block : 'content', |