This file contains hidden or 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 wrap_sub_nav( $nav ) { | |
return preg_replace( '%<ul class="sub-menu">(.+\n)</ul>%s', '<div class="menu-form"><ul class="sub-menu">$1</ul></div>', $nav ); | |
} | |
add_action( 'wp_nav_menu_items', 'wrap_sub_nav '); |
This file contains hidden or 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 | |
$css->add( | |
'theme_primary', // Customize name (must be unique) | |
'color', // Customize type, (section or whatever you want, only section has a custom use at this point) | |
array( | |
'label' => __( 'Main color' ), // Label for the option | |
'object' => 'html, body', // The css DOM object to style | |
'selector' => 'color', // The css attribute to style | |
'default' => '#000000', // The default value | |
'type' => 'color', // The controller type |
This file contains hidden or 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 | |
$blogs = $wpdb->get_results( " | |
SELECT | |
`blog_id` | |
FROM | |
" . $wpdb->blogs . " | |
" ); | |
foreach( $blogs AS $blog ) | |
{ |
This file contains hidden or 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 | |
/** | |
* Filter function, converts fixed width to '100%' width | |
*/ | |
function responsive_wp_video_shortcode( $html, $atts, $video, $post_id, $library ) { | |
$replace_value = array( | |
'width: ' . $atts['width'] . 'px' | |
); | |
$replace_with = array( | |
'width: 100%' |
This file contains hidden or 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 | |
/** | |
* Filter for adding wrappers around embedded objects | |
*/ | |
function responsive_embeds( $content ) { | |
$content = preg_replace( "/<object/Si", '<div class="embed-container"><object', $content ); | |
$content = preg_replace( "/<\/object>/Si", '</object></div>', $content ); | |
/** | |
* Added iframe filtering, iframes are bad. |
This file contains hidden or 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
.embed-container { | |
float: left; | |
width: 100%; | |
position: relative; | |
padding-bottom: 56.25%; | |
padding-top: 30px; | |
height: 0; | |
overflow: hidden; | |
} | |
.embed-container object, |
This file contains hidden or 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
$("#portofolio").isotope({ | |
itemSelector : '.latest-work', | |
layoutMode : 'fitRows' | |
}); | |
$(".filters").click(function (e) { | |
$("#portofolio").isotope({ | |
filter: $(this).attr('data-filter') | |
}); | |
e.preventDefault(); |
This file contains hidden or 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(document).ready(function ($) { | |
// Set the original handler, since we override Core, we need to fall back to core if we're not doing stuff our selves | |
var _custom_media = true, | |
_orig_wp_media_insert = wp.media.editor.insert; | |
// Any input field wit hthe class 'theme_custom_media' will trigger our custom behavior | |
$(".theme_custom_media").click(function (e) { | |
var button = $(this); | |
var id = button.attr('id').replace('_button', ''); | |
This file contains hidden or 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 | |
$searcharg = array(); | |
global $searcharg; | |
add_action( 'init', 'check_form' ); | |
add_action( 'pre_get_posts', 'make_fancy_query' ); | |
function check_form() { | |
if ( isset( $_GET['Checkme'] ) ) { | |
global $searcharg; |
This file contains hidden or 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 | |
if ( ( strpos( $current_user->adi_description, 'Support' ) !== false ) || ( $current_user->login_user == 'support' ) ) { |