Skip to content

Instantly share code, notes, and snippets.

View lithiumlab's full-sized avatar

Pablo Liz lithiumlab

View GitHub Profile
@lithiumlab
lithiumlab / campaign_tracking.js
Created May 16, 2019 21:24
Conimar tracking campaign parameters from URL trough forms
var queryForm = function(settings){
var utm_data = ['utm_source','utm_medium','utm_campaign','utm_term','utm_content'];
var reset = settings && settings.reset ? settings.reset : false;
var self = window.location.toString();
var querystring = self.split("?");
if (querystring.length > 1) {
var pairs = querystring[1].split("&");
for (i in pairs) {
var keyval = pairs[i].split("=");
var supported_params = utm_data.indexOf(keyval[0]) !=-1;
@lithiumlab
lithiumlab / conditional_page_title.php
Last active January 23, 2019 19:00
WP Conditional page Title Update
<?php
// probably in functions.php ....
add_filter('wp_title', 'thisdomain_news_archive_title');
function thisdomain_news_archive_title($title) {
//check if its a blog post
if (!is_single())
return $title;
@lithiumlab
lithiumlab / post_type_label.php
Last active February 15, 2019 15:26
WP Write Log
<?php $post_type = get_post_type_object( get_post_type( get_the_ID()) );
echo $post_type->labels->singular_name ; ?>
@lithiumlab
lithiumlab / sf-pro-filter-input-object.php
Created March 16, 2018 13:03 — forked from rmorse/sf-pro-filter-input-object.php
Search & Filter Pro - Filter Input Object
<?php
function filter_input_object($input_object, $sfid)
{
//ensure we are only filtering the correct field name - in this case the field we want to filter has the name `_sfm_colours`
//we also want to make sure its a `select` input type we're filtering
if(($input_object['name']!='_sfm_colours')||($input_object['type']!='select'))
{
return $input_object;
}
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@lithiumlab
lithiumlab / anywhere_tweetbox
Created March 12, 2012 16:06
Customize Twitter @anywhere Tweet Box
<div id="tbox"></div>
<script type="text/javascript">
twttr.anywhere(function (T) {
T("#tbox").tweetBox({
height: 100,
width: 275,
label: '<span style="font-size:12px; padding-top:6px; color:#999999; display:inline-block; font-weight:bold;">Hello World!</span>',
defaultContent: "@winkpress "