This file contains hidden or 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 /* response to question 2059 on wpquestions.com from jlannigan (julianlannigan.com) */ ?> | |
<div class="subscribe clearfix"> | |
<h3> | |
<a href="<?php echo home_url("/?feed=rss"); ?>"> | |
<img class="i_rss" alt="" src="<?php echo home_url("/wp-content/themes/GeoPlaces/images/i_rss.png"); ?>"> | |
</a> | |
</h3> | |
<form name="ccoptin" action="http://oi.vresp.com?fid=f630be0279" target="vr_optin_popup" method="post" class="subscribe_form" onsubmit="window.open( 'http://www.verticalresponse.com', 'vr_optin_popup', 'scrollbars=yes,width=600,height=450' ); return true;"> | |
<p>Your Email</p> | |
<input type="text" value="" name="email" class="field"> |
This file contains hidden or 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 //answer to wpquestions.com #2150 by Julian Lannigan (julianlannigan.com) | |
function article_series() { | |
global $post; | |
$series = get_post_meta($post->ID, 'edit_cat', true); | |
$currentPost = $post; | |
if ($series) { | |
$args = array( | |
'numberposts' => 5, |
This file contains hidden or 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 // answer to wpquestions.com #2143 by Julian Lannigan (julianlannigan.com) | |
function override_logout_form() { | |
wp_logout(); | |
$logoutDestination = '/'; | |
$redirect_to = !empty($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : $logoutDestination; | |
wp_safe_redirect($redirect_to); | |
exit(); | |
} | |
add_action('login_form_logout', 'override_logout_form'); |
This file contains hidden or 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 // answer to wpquestions.com #2245 by Julian Lannigan (julianlannigan.com) | |
// GET THE DATA | |
$customFieldName = 'event_date'; | |
$outputData = array(); | |
$currentDate = time(); | |
$queryArgs = array( | |
'posts_per_page' => -1, | |
'meta_query' => array( |
This file contains hidden or 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 // answer to wpquestions.com #2235 by Julian Lannigan (julianlannigan.com) | |
function coauthor_add_to_wardrobe_link() { | |
$currentUrl = "http".(($_SERVER["HTTPS"] == "on") ? "s" : "")."://".$_SERVER["SERVER_NAME"].(($_SERVER["SERVER_PORT"] != "80") ? ":".$_SERVER["SERVER_PORT"] : "").$_SERVER["REQUEST_URI"]; //Gets current page url | |
if (defined('COAUTHORS_PLUS_VERSION')) { | |
global $current_user; | |
if (is_user_logged_in()) { | |
//Check if they have requested to be an author | |
if (isset($_REQUEST['addToWardrobe']) && is_numeric($_REQUEST['addToWardrobe']) && $_REQUEST['addToWardrobe'] > 0) { | |
if (!is_coauthor_for_post($current_user->user_login, $_REQUEST['addToWardrobe'])) { | |
$cAuthors = array(); |
This file contains hidden or 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 | |
/**** ADD FB IMAGES***/ | |
//Adding the Open Graph in the Language Attributes | |
function add_opengraph_doctype( $output ) { | |
return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"'; | |
} | |
add_filter('language_attributes', 'add_opengraph_doctype'); | |
//Lets add Open Graph Meta Info |
This file contains hidden or 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
The plain text icon used can be downloaded from: | |
http://www.iconfinder.com/icondetails/9091/128/plain_text_icon | |
I used the 16x16 version of the above. |
This file contains hidden or 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 register_price() { | |
$direction = "DESC"; //Default direction | |
if (isset($_GET["order_dir"]) && $_GET["order_dir"] == "ASC") { | |
$direction = "ASC"; | |
} | |
register_custom_queryable_field("price", array("dataType" => "numeric", "order" => $direction)); | |
} | |
?> |
This file contains hidden or 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
var fs = require("fs"); | |
var logPath = "C:\\wamp\\www\\sandbox\\node\\gigya\\log"; | |
var dates = {}; | |
fs.readdir(logPath, function(err, files) { | |
files.forEach(function(i) { | |
var m = i.match(/([0-9]+)/gi); | |
if (typeof dates[m[0]] == "undefined") dates[m[0]] = []; | |
This file contains hidden or 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
{ | |
"cmd": ["bin/run_dev_debug.sh", "/usr/local/bin/node", "bootstrap.js"], | |
"selector": "source.js", | |
"working_dir": "/Users/Julian/Work/boomerang", | |
"path": "/usr/local/bin/" | |
} |
OlderNewer