Skip to content

Instantly share code, notes, and snippets.

View DavidWells's full-sized avatar
😃

David Wells DavidWells

😃
View GitHub Profile
@DavidWells
DavidWells / landing-page-config-example.php
Created February 1, 2014 02:12
This is a demo template for developers and designers to use as a reference for building landing page templates for the free Wordpress Landing Pages Plugin http://wordpress.org/plugins/landing-pages . See full demo template here: https://github.com/inboundnow/landing-pages/tree/master/templates/demo
<?php
/**
* WordPress Landing Page Config File
* Template Name: Demo Template
* @package WordPress Landing Pages
* @author Inbound Now
*
* This is a demo template for developers and designers to use as a reference for building landing page templates
* for Wordpress Landing Pages Plugin http://wordpress.org/plugins/landing-pages/
*
@DavidWells
DavidWells / hiring-odesk-developer-example.txt
Created February 1, 2014 03:21
Hiring Odesk Devs Example
Hi,
We need an HTML landing page converted to a WordPress Landing Pages Plugin template.
Application Requirements:
- Theming &amp; coding experience with WordPress.
- Experience with PHP, CSS, jQuery, HMTL.
- Understanding of WordPress Landing Pages plugin and how to create custom landing page templates.
Job Requirements:
jQuery(document).ready(function($) {
jQuery('#lp_container').appendTo('.right-sidebar-wrapper');
});
@DavidWells
DavidWells / enable-mailchimp-double-opt-in.php
Last active August 29, 2015 13:55
Enable Double-Optin for InboundNow’s MailChimp Extension.
<?php
add_filter('inboundnow_mailchimp_args','mc_enable_double_opt');
function mc_enable_double_opt( $args ) {
$args['double_optin'] = true;
return $args;
}
@DavidWells
DavidWells / remove-inbound-marketing-admin-bar.php
Last active August 29, 2015 13:55
Remove inbound now marketing admin bar for all but admin users. Add this snipper to your functions.php file
<?php
function remove_inbound_admin_bar() {
global $wp_admin_bar;
if ( is_user_logged_in() && !current_user_can( 'manage_options' )) {
$wp_admin_bar->remove_menu('inbound-admin-bar');
}
}
add_action( 'wp_before_admin_bar_render', 'remove_inbound_admin_bar' );
@DavidWells
DavidWells / kill_form_specific_for_on_page_tracking.php
Last active August 29, 2015 13:56
Remove tracking from all forms on a given page for WordPress Leads
<?php
// Add to your themes function.php file without the opening <?php tag
add_action('wp_head', 'kill_form_tracking_for_specific_pages')
if (!function_exists('kill_form_tracking_for_specific_pages')) {
function kill_form_tracking_for_specific_pages(){
// targeting page ID 106. Replace with your specific page ID
if (is_page(106)) {
echo '<script type="text/javascript">
jQuery(document).ready(function($) {
jQuery("form").each(function(){
@DavidWells
DavidWells / genesis-wordpress-landing-page-fix.php
Last active August 29, 2015 13:56
Wordpress Landing pages and genesis <title> fix
<?php // Remove this <?php tag before inserting to functions
add_action( 'after_setup_theme', 'fix_bad_genesis_filter');
function fix_bad_genesis_filter() {
// fix for genesis and catalyst framework
$priority = ( function_exists( 'genesis' ) ) || ( function_exists( 'catalyst_activate' ) ) ? 6 : 50;
add_filter('wp_title','lp_ab_testing_alter_title_area', $priority, 3 );
}
@DavidWells
DavidWells / genesis-fix.php
Created February 5, 2014 01:33
Genesis fix take two
<?php
add_action( 'template_redirect', 'child_conditional_actions' );
function child_conditional_actions() {
if( 'landing-page' == get_post_type() ) {
remove_filter( 'wp_title', 'genesis_doctitle_wrap', 20 );
}
}
@DavidWells
DavidWells / custom-js-function-on-inbound-form-completion.js
Created February 7, 2014 21:46
Trigger custom javascript on inbound form completion
jQuery(document).ready(function($) {
// Trigger custom script on inbound now form completion
$(".wpl-track-me").on("inbound_form_complete", function() {
// do stuff
});
});
@DavidWells
DavidWells / turn-off-landing-page-script-elsewhere-on-site.php
Last active August 29, 2015 13:56
Turn off landing page javascript on non landing page post types. Warning: This will break lead tracking for other pages
/* Fair warning this will break page tracking */
add_action( ‘wp_print_scripts’, ‘turn_off_lp_script’, 120 );
function turn_off_lp_script(){
global $post;
if (isset($post) && $post->post_type != 'landing-page') {
wp_dequeue_script( ‘jquery-cookie’ );
wp_deregister_script( ‘jquery-total-storage’ );
}
}