This file contains 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 | |
/** | |
* Plugin Name: Page Parent Link | |
*/ | |
function my_the_content( $content ) { | |
$post = get_post(); | |
if ( 'page' == $post->post_type && $post->post_parent > 0 ) { | |
$parent = new WP_Query( array( | |
'post_type' => 'page', | |
'post__in' => array( $post->post_parent ), |
This file contains 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_filter( 'pl_opt-textbox_title', 'hack_title' ); | |
function hack_title( $opt ) { | |
global $post; | |
if( 4125 == $post->ID ) | |
return 'Hello World!'; | |
else | |
return $opt; | |
} |
This file contains 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
jQuery( "i" ).each(function( e ) { | |
var classes = jQuery(this).attr('class') || '' | |
var check = classes.indexOf("icon-"); | |
if( -1 != check ) { | |
jQuery(this).attr('class', 'icon ' + classes) | |
} | |
}) |
This file contains 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 | |
class Section_Overide { | |
function __construct() { | |
add_filter( 'pagelines_render_section', array( $this, 'section_overide' ), 10, 2 ); | |
} | |
function section_overide( $s, $class ) { | |
This file contains 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 remove_post_thumbnail($metadata, $object_id, $meta_key, $single){ | |
if( isset($meta_key) && '_thumbnail_id' === $meta_key && is_single() ) | |
return false; | |
else | |
return $metadata; | |
} | |
add_filter('get_post_metadata', 'remove_post_thumbnail', true, 4); |
This file contains 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
// from http://www.pagelinestheme.com/make-content-width-section-full-width/ | |
// overriding dms/dms/less/pl-structure.less | |
body.display-boxed #site .boxed-wrap .pl-area.makestuffinsidefullwidth .pl-area-wrap > .pl-content { | |
padding-left: 0px; | |
padding-right: 0px; | |
} | |
body.display-full #site .pl-area.makestuffinsidefullwidth .pl-content { | |
max-width: none; | |
} |
This file contains 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 | |
/* | |
* NOTE: 2 varibales passed here... | |
*/ | |
add_filter( 'pl-area-inner-classes', 'my_classes_filter', 10, 2 ); | |
/* | |
* Filter function now needs 2 variables | |
* 1st is the actual value being filtered | |
* 2nd is the section meta data in the form of an array. |
This file contains 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 load_mc_iris() { | |
if (wp_script_is( 'iris', 'enqueued' )) { | |
return; // if it's already enqueued, don't enqueue it again. | |
} else { // since it's NOT enqueued, let's enqueue it | |
wp_enqueue_script( | |
'iris', //iris.js handle | |
admin_url( 'js/iris.min.js' ), //path to wordpress iris file |
This file contains 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_filter('acf/location/rule_types', 'acf_location_rules_types'); | |
function acf_location_rules_types( $choices ) { | |
$choices['Page']['pagelinespage'] = 'Pagelines Page'; | |
return $choices; | |
} | |
// Find pages | |
add_filter('acf/location/rule_values/pagelinespage', 'acf_location_rules_values_pagelinespage'); |