Skip to content

Instantly share code, notes, and snippets.

View jillmugge's full-sized avatar

Jill jillmugge

View GitHub Profile
@jillmugge
jillmugge / PODS & LB Images
Created April 22, 2014 14:59
Adding Img from PODS via LB
<?php
//adding images from Pods to Loopbuddy
add_shortcode('jmg_custom_image_before', 'get_custom_field_1');
function get_custom_field_1() {
global $post;
return '<a href="'.get_post_meta($post->ID, "before_lightbox.guid", true).'" rel="themeblvd_lightbox[before]" title="'.get_post_meta($post->ID, "before_image_title", true).'"><img src="'.get_post_meta($post->ID, "before.guid", true).'" class="before-image"></a>';
}
@jillmugge
jillmugge / Making LoopBuddy compatible
Created April 22, 2014 14:58
Making LoopBuddy compatible with other themes
<?php
//LoopBuddy Support. Place in functions.php
add_theme_support('loop-standard');
if ( ! function_exists( 'dynamic_loop' ) ) {
function dynamic_loop() {
global $dynamic_loop_handlers;
if ( empty( $dynamic_loop_handlers ) || ! is_array( $dynamic_loop_handlers ) )
return false;
ksort( $dynamic_loop_handlers );
@jillmugge
jillmugge / filter <p> tags
Created April 22, 2014 14:56
filter <p> on images
<?php
//filter <p> on images
function filter_ptags_on_images($content){
return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
}
add_filter('the_content', 'filter_ptags_on_images');
@jillmugge
jillmugge / Select the Facebook Image
Last active March 26, 2016 16:59
Select the Facebook Image to use as thumbnail. Check Facebook results here: https://developers.facebook.com/tools/debug/og/object/ Place code below in functions.php, then call function in <head></head>
<?php
function facebook_thumbnail(){
echo '<meta property="og:image" content="http://jmgmarketinggroup.com/jmg/wp-content/uploads/JMG-Logo-v4.png" />
<meta property="og:type" content="website" />
<meta property="og:title" content="JMG Marketing Group | Dedicated to Building Websites that Pay for Themselves" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon" >
';
@jillmugge
jillmugge / PODS Export
Created April 22, 2014 14:54
PODS Export
{"meta":{"version":"2.3.8","build":1372866920},"pods":{"30":{"type":"pod","id":30,"name":"bookmark","label":"Bookmarks","description":"","storage":"table","object":"","alias":"","fields":{"name":{"id":31,"name":"name","label":"Name","description":"","help":"","class":"","type":"text","weight":0,"pick_object":"","pick_val":"","sister_id":"","required":"1","text_repeatable":"0","unique":"0","text_max_length":"255","text_allowed_html_tags":"strong em a ul ol li b i"},"url":{"id":36,"name":"url","label":"URL","description":"","help":"","class":"","type":"text","weight":1,"pick_object":"","pick_val":"","sister_id":"","text_max_length":"255","text_allowed_html_tags":"strong em a ul ol li b i","text_allow_html":"0","text_allow_shortcode":"0","text_repeatable":"0","unique":"0","required":"0","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","roles_allowed":["administrator"]},"section":{"id":37,"name":"section","label":"Section","description":"","help":"","class":"","type":"pick","weight":2,"
@jillmugge
jillmugge / excerpt length
Created April 22, 2014 14:53
Change the excerpt length
<php
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
@jillmugge
jillmugge / Event Manager Tweeks
Created April 22, 2014 14:53
Event Manager CSS Tweeks
/*****************************************************
Custom CSS for Tweaking Events Manager Webinar
*****************************************************/
#builder-module-525c349e97bee-background-wrapper {
background: url(images/events-bkgd.jpg) no-repeat center top;
background-size: cover;
color: #fff;
padding-top: 50px;
}
@jillmugge
jillmugge / enqueue vidBG - jQuery
Created April 22, 2014 14:52
enqueue jquery.videoBG
<?php
function load_custom_scripts(){
wp_register_script( 'jquery.videoBG', get_stylesheet_directory_uri() . '/js/jquery.videoBG.js', array('jquery'));
wp_enqueue_script( 'jquery.videoBG' );
}
add_action( 'wp_enqueue_scripts', 'load_custom_scripts' );
@jillmugge
jillmugge / jQuery - add div for parallax
Last active August 29, 2015 14:00
Add Div to Builder (outside of Container) for parallax scroll
function parallax(){
var scrolled = jQuery(window).scrollTop();
jQuery('.custom-bg').css('left', -(scrolled * 0.2) + 'px');
jQuery('.custom-bg').css('top', -(scrolled *0.3) + 'px');
}
jQuery(window).scroll(function(e){
parallax();
});
@jillmugge
jillmugge / Deflate .htaccess
Created April 22, 2014 14:48
Deflate .htaccess for speed
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript