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 my_function_name() { | |
$postid = $_POST['postid']; | |
$rating = $_POST['rating']; | |
update_post_meta( $postid, 'delivery_rating', $rating ); | |
wp_die(); | |
} | |
add_action( 'wp_ajax_my_function_name', 'my_function_name' ); |
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() { | |
$('.driver-rating').barrating({ | |
theme: 'fontawesome-stars', | |
initialRating: "<?php echo $averageRating; ?>", | |
showSelectedRating: true, | |
// onSelect is what triggers the saving of the rating. | |
onSelect: function(value, text, event) { | |
// Get element id by data-id attribute | |
var el = this; |
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 kol_md_popups() { | |
if ( ! is_page( 'md-popups' ) ) | |
return; | |
?> | |
<style type="text/css"> | |
@media all and (min-width: 1000px) { | |
.md-popups-content { | |
float: right; | |
width: 546px; |
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 | |
/** | |
* Reorders get_categories() to list categories by | |
* the most posts to least. | |
* | |
* Example use: listing the most popular categories | |
* on your blog. print_r() function to see results. | |
*/ | |
function kol_most_active_categories( $args = null ) { |
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() { | |
document.getElementById( 'md_no_sidebar' ).onchange = function( e ) { | |
document.getElementById( 'md_custom_sidebar_option' ).style.display = this.checked ? 'none' : 'block'; | |
} | |
} )(); |
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
/** | |
* Based off Thomas Griffin's New Media Image Uploader. | |
* Thanks for that, man. | |
* https://github.com/thomasgriffin/New-Media-Image-Uploader | |
*/ | |
jQuery( document ).ready( function( $ ) { | |
var kol_media_frame; |
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 // Pagination ?> | |
<?php | |
$big = 999999999; | |
$total = $kolfolio->max_num_pages; | |
$paginate = paginate_links( array( | |
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), | |
'format' => '?paged=%#%', | |
'current' => max( 1, get_query_var( 'paged' ) ), | |
'prev_text' => __( '← Previous', 'kol' ), |
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('.js-tab-link a').click(function(){ | |
var that = jQuery(this); | |
var tabIndex = that.parent().index(); | |
var tabs = that.parents('.gallery-item').find('.gallery-cover-content'); | |
that.parent('.js-tab-link').siblings().removeClass('gallery-active'); | |
that.parent('.js-tab-link').addClass('gallery-active'); | |
tabs.removeClass('gallery-active'); | |
tabs.eq(tabIndex).addClass('gallery-active'); |