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
if (function_exists('icl_get_languages')){ | |
$languages = icl_get_languages('skip_missing=0'); | |
$lang_html = ''; | |
foreach($languages as $lang){ | |
$lang_html .= '<div'; | |
if ( $lang['native_name'] == ICL_LANGUAGE_NAME){ | |
$lang_html .= ' class="current-menu-item current_language lng"'; | |
} | |
else{ | |
$lang_html .= ' class="lng"'; |
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 | |
// get the id of page laying next to the given one | |
// and only those that are chosen by meta value show_in_selected = 1 | |
function prev_next_page($step){ | |
global $post; | |
$actual_menu_order = $post->menu_order; | |
$args = array( | |
'post_type' => $post->post_type, | |
'posts_per_page' => -1, // we have to get all in order to get cycle results | |
'post_status' => 'publish', |
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
function() { | |
$('a.scroll').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
$('html,body').animate({ | |
scrollTop: target.offset().top | |
}, 1000); | |
return false; |
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
$heading_image_url = MultiPostThumbnails::get_post_thumbnail_url('page', 'project-headr',$post->ID, 'full'); |
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 | |
/* | |
Plugin Name: Theme drive | |
Description: Display different theme to user if logged in as admin | |
Author: Kyle Barber | |
*/ | |
add_filter('template', 'change_theme'); | |
add_filter('option_template', 'change_theme'); | |
add_filter('option_stylesheet', 'change_theme'); | |
function change_theme($theme) { |
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
INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('4', 'demo', MD5('demo'), 'Your Name', '[email protected]', 'http://www.test.com/', '2011-06-07 00:00:00', '', '0', 'Your Name'); | |
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); | |
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_user_level', '10'); |
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
// register json feed | |
class custom_feed { | |
public $feed = 'json'; | |
public function __construct() { | |
add_action( 'init', array( $this, 'init' ) ); | |
} | |
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
pkill -9 -f 'Transmit Disk' |
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
/** prevent uploading of .bmp files. */ | |
add_filter('upload_mimes', function(array $mimes) | |
{ | |
unset($mimes['bmp']); | |
unset($mimes['png']); | |
return $mimes; | |
}); |