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
var total = 0; | |
$('.ClassName').each(function() { | |
total+= $(this).width(); | |
total+= parseInt($(this).css('margin-left'), 0); | |
total+= parseInt($(this).css('margin-right'), 0); | |
total+= 0; | |
}); | |
var num_blocks = $('.ClassName').size(); |
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 | |
/*========================================= | |
Custom Submit Box | |
==========================================*/ | |
/** | |
* Loop throught custom post types and | |
* replace default submit box | |
* | |
* @since 1.0 | |
* |
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
$(window).scroll(function() { | |
var y_scroll_pos = window.pageYOffset; | |
var scroll_pos_test = 500; | |
// set to whatever you want it to be | |
if(y_scroll_pos > scroll_pos_test) { | |
$("body").css("background-color","#000"); | |
} | |
else | |
{ |
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 | |
global $product; | |
$attachment_ids = $product->get_gallery_attachment_ids(); | |
foreach( $attachment_ids as $attachment_id ) | |
{ | |
//Get URL of Gallery Images - default wordpress image sizes | |
echo $Original_image_url = wp_get_attachment_url( $attachment_id ); | |
echo $full_url = wp_get_attachment_image_src( $attachment_id, 'full' )[0]; | |
echo $medium_url = wp_get_attachment_image_src( $attachment_id, 'medium' )[0]; |
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
// Display Taxomonies | |
$terms = get_terms( 'fw-portfolio-category' ); // Taxomony Name | |
foreach ( $terms as $term ) { | |
// The $term is an object, so we don't need to specify the $taxonomy. | |
$term_link = get_term_link( $term ); | |
// If there was an error, continue to the next term. | |
if ( is_wp_error( $term_link ) ) { |
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 | |
/* | |
http://manual.unyson.io/en/latest/options/introduction.html#content | |
*/ | |
$options = array( | |
'tab_1' => array( | |
'title' => esc_html__('Logo Options', 'academic'), | |
'type' => 'tab', | |
'options' => array( | |
'heading' => 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
{ | |
"plugins": [ | |
"query-monitor", | |
"regenerate-thumbnails", | |
{ | |
"slug": "envato-theme-check", | |
"source": "https://github.com/envato/envato-theme-check/archive/master.zip" | |
} |
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_action( 'init', 'cix_new_hooks'); | |
function cix_new_hooks(){ | |
remove_action( 'wp_ajax_porto_product_quickview', 'porto_product_quickview' ); | |
remove_action( 'wp_ajax_nopriv_porto_product_quickview', 'porto_product_quickview' ); | |
add_action( 'wp_ajax_porto_product_quickview', 'cix_porto_product_quickview' ); | |
add_action( 'wp_ajax_nopriv_porto_product_quickview', 'cix_porto_product_quickview' ); | |
} |
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
function deletePostType($postType = ''){ | |
global $wpdb; | |
$result = $wpdb->query( | |
$wpdb->prepare(" | |
DELETE posts,pt,pm | |
FROM {$wpdb->prefix}posts posts | |
LEFT JOIN {$wpdb->prefix}term_relationships pt ON pt.object_id = posts.ID | |
LEFT JOIN {$wpdb->prefix}postmeta pm ON pm.post_id = posts.ID | |
WHERE posts.post_type = %s |
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
add_action('wp_head','bp_preorder_script'); | |
function bp_preorder_script() { | |
$args = array( | |
'post_type' => 'product_variation', | |
'posts_per_page' => -1, | |
); | |
$query = new WP_Query( $args ); | |
OlderNewer