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
.wpuprogress { | |
position: fixed; /* Çubuğun sayfada sabit kalması için. */ | |
top: 0; /* Çubuğu sayfanın en üstüne aldık. */ | |
height: 2px; /* Çubuğun kalınlığını artırmak için 2 sayısını değiştirebilirsiniz. */ | |
background-color: #f44336; /* Çubuğun rengi. */ | |
} |
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 wpu_scripts() { | |
wp_enqueue_script( 'wpu-progressBar', get_template_directory_uri() . '/js/progressBar.js', array(), '1.0.0', true ); | |
} | |
add_action( 'wp_enqueue_scripts', 'wpu_scripts' ); |
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
<div class="wpuprogress"></div> |
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
$(document).ready(function () { | |
var winHeight = $(window).height(), | |
docHeight = $(document).height(), | |
progressBar = $('.wpuprogress'), | |
max, value; | |
max = docHeight - winHeight; | |
$(document).on('scroll', function(){ | |
value = $(window).scrollTop(); |
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 _get_all_meta_values($key) { | |
global $wpdb; | |
$result = $wpdb->get_col( | |
$wpdb->prepare( " | |
SELECT DISTINCT pm.meta_value FROM {$wpdb->postmeta} pm | |
LEFT JOIN {$wpdb->posts} p ON p.ID = pm.post_id | |
WHERE pm.meta_key = '%s' | |
AND p.post_status = 'publish' | |
ORDER BY pm.meta_value", | |
$key |
NewerOlder