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
<!-- Enqueue fullcalender.io ---> | |
<style> | |
#calendar { | |
max-width: 900px; | |
margin: 0 auto; | |
} | |
</style> | |
<?php | |
for ( $upcoming_events as $upcoming_event ) { | |
$upcoming_event_object = 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 login_form_frontend($args = array()) { | |
$defaults = array('echo' => true, | |
'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], // Default redirect is back to the current page | |
'form_id' => 'loginformfrontend', | |
'label_username' => __('Username'), | |
'label_password' => __('Password'), | |
'label_remember' => __('Remember Me'), | |
'label_log_in' => __('SIGN IN'), | |
'id_username' => 'user_login', | |
'id_password' => 'user_pass', |
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
$('table').DataTable( { | |
dom: 'T<"clear">lfrtip', | |
tableTools: { | |
"sSwfPath": "../swf/copy_csv_xls_pdf.swf", //path to your swf folder | |
"aButtons": [ | |
{ | |
"sExtends": "pdf", | |
"sPdfOrientation": "landscape", | |
"sPdfMessage": "Attendence Report For <?php echo get_the_title($event_id_url);?>", | |
"sButtonText": "Export to PSD" |
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
gnome-desktop-item-edit --create-new ~/Desktop |
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
// SCRIPT FOR PRODUCT SIDEBAR STICKY (EXPANDABLE) | |
function collision($div1, $div2) { | |
if ( $div1.length > 0 && $div2.length > 0 ) { | |
var x1 = $div1.offset().left; | |
var y1 = $div1.offset().top; | |
var h1 = $div1.outerHeight(true); | |
var w1 = $div1.outerWidth(true); | |
var b1 = y1 + h1; | |
var r1 = x1 + w1; | |
var x2 = $div2.offset().left; |
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
Firstly install Sublime -text Installer | |
sudo apt-get purge sublime-text-installer | |
Than | |
sudo dpkg -i sublime-text_build-3124_amd64.deb |
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 | |
echo paginate_links( array( | |
'base' => @add_query_arg('paged','%#%'), | |
'format' => '?paged=%#%', | |
'current' => (get_query_var('paged')) ? get_query_var('paged') : 1, | |
'mid-size' => 1, | |
'total' => $cat_posts->max_num_pages | |
) ); |
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 | |
$upload_dir = wp_upload_dir(); | |
$image_data = file_get_contents($image_url); | |
$filename = basename($image_url); | |
if(wp_mkdir_p($upload_dir['path'])) $file = $upload_dir['path'] . '/' . $filename; | |
else $file = $upload_dir['basedir'] . '/' . $filename; | |
file_put_contents($file, $image_data); | |
$wp_filetype = wp_check_filetype($filename, null ); |
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 my_oembed_fetch_url( $provider, $url, $args ) { | |
if ( strpos( $provider, 'vimeo.com' ) !== false) { | |
if ( isset( $args['autoplay'] ) ) { | |
$provider = add_query_arg( 'autoplay', absint( $args['autoplay'] ), $provider ); |
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_class_filter( $tag, $class_name = '', $method_name = '', $priority = 10 ) { | |
global $wp_filter; | |
// Check that filter actually exists first | |
if ( ! isset( $wp_filter[ $tag ] ) ) return FALSE; | |
if ( is_object( $wp_filter[ $tag ] ) && isset( $wp_filter[ $tag ]->callbacks ) ) { | |
// Create $fob object from filter tag, to use below | |
$fob = $wp_filter[ $tag ]; | |
$callbacks = &$wp_filter[ $tag ]->callbacks; | |
} else { |