Skip to content

Instantly share code, notes, and snippets.

@atwellpub
atwellpub / functions.php
Created July 18, 2014 00:21
Add this code to your theme's functions.php code to enable geoplugin.com's geotargeting js script and auto-set the country dropdown to the correct country code
<?php
/**
* Adds geotargeting js capabilities to javascript
*/
add_action( 'wp_enqueue_scripts' , 'inbound_add_geotargeting_js' );
function inbound_add_geotargeting_js () {
wp_enqueue_script( 'geoplugin' , 'http://www.geoplugin.net/javascript.gp');
}
@atwellpub
atwellpub / functions.php
Created July 16, 2014 18:24
Temporary fix for Woocommerce 'proceed to checkout' bug while Inbound Now tools are installed.
<?php
/**
* Removes tracking class 'wpl-track-me' from woocommerce cart display form'
*/
add_action('wp_footer' , 'remove_cart_tracking_class');
function remove_cart_tracking_class() {
?>
<script type='text/javascript'>
jQuery( document ).ready(function() {
@atwellpub
atwellpub / single-landing-page.php
Created July 15, 2014 23:57
Example single-landing-pages.php file for integrating the landing-page custom post type with an active WordPress theme.
<?php get_header(); ?>
<?php $left_or_right = lp_get_value($post, 'default', 'sidebar'); ?>
<div id="main" class="container">
<?php if($left_or_right === "left") { ?>
<!-- SIDEBAR START -->
<section id="sidebar" class="grid one-third">
<?php lp_conversion_area(); /* Print out form content */ ?>
</section>
@atwellpub
atwellpub / single-landing-page.php
Created July 15, 2014 23:56
Example of how to import the custom setting added to the default landing page template options.
/* Landing Page Meta Values */
$sidebar = lp_get_value($post, 'default', 'sidebar');
$display_nav = lp_get_value($post, 'default', 'display-nav');
$new_setting = lp_get_value($post, 'default', 'new_setting');
lp_conversion_area(); /* Print out form area content */
@atwellpub
atwellpub / example.php
Last active August 29, 2015 14:04
Adds settings to the 'default' landing page template via custom plugin code or an active theme's functions.php file
<?php
add_filter('lp_extension_data','lp_rebuild_old_data_configurations_to_suit_new_convention');
function lp_rebuild_old_data_configurations_to_suit_new_convention($lp_data)
{
$lp_data['default']['settings']['new_setting'] = array(
'label' => "New setting",
'description' => "Description of new setting here. Will be placed in tooltip"
'id' => 'new_setting',
@atwellpub
atwellpub / wordpress-nav-meny-js-handler.php
Created May 28, 2014 23:52
WordPress Plugin - Print Nav Menu - API
<?php
/*
Plugin Name: Print Nav Menu API
Plugin URI: http://www.inboundnow.com/landing-pages/
Description: Listens for nav menu requests and returns html content
Version: 1.0.1
Author: Hudson Atwell
Author URI: http://www.hudsonatwell.co
*/
@atwellpub
atwellpub / .php
Created May 16, 2014 23:16
Example single-landing-page.php file for Genesis Child Theme
<?php
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
/** Remove the entry meta in the entry header (requires HTML5 theme support) */
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
/** uncomment line below if you are using any after post widgets */
remove_action( 'genesis_after_post_content', 'genesis_after_post' );
@atwellpub
atwellpub / html.html
Created April 30, 2014 20:11
Fix for GoToWP embedded forms when Lead Tracking with WordPress Leads
<script>
jQuery(document).ready(function($) {
jQuery('#gotowp_personal_webinar_registration').addClass('wpl-track-me');
jQuery('#gotowp_personal_webinar_registration input[name="submit"]').attr('name' , 'go');
});
</script>
@atwellpub
atwellpub / example-cta-variation-shortcode
Created April 20, 2014 19:42
Example call to action shortcode that targets variation
[cta id="404" vid='2']
@atwellpub
atwellpub / example.html
Created April 19, 2014 21:24
How to tell Calls to Action not to track a link as a conversion.
<a href='http://www.inboundnow.com' class='do-not-track'>Inbound Now</a>