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
| $(document).ready(function(){ | |
| $('html, body').scrollTop(0); | |
| $(window).on('load', function() { | |
| setTimeout(function(){ | |
| $('html, body').scrollTop(0); | |
| }, 0); | |
| }); | |
| }); |
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
| /** | |
| fungsi ini untuk memotong ukuran judul / title yang panjang lebih dari 55 karakter, | |
| karakter itu meliputi space dan huruf. | |
| fungsi : | |
| <?php potong_kar(get_the_title(),55,'...');?> | |
| judul di potong jika lebih dari 55 dan selanjutnya akan di replace menggunkan tanda "..." (tanpa petik " ") | |
| */ | |
| function view_post(){ | |
| $related = ci_get_related_posts( get_the_ID(), 5 ); |
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 jetpack_infinite_scroll_query_args( $args ) { | |
| $args['order'] = 'ASC'; | |
| $args['orderby'] = 'name'; | |
| return $args; | |
| } | |
| add_filter( 'infinite_scroll_query_args', 'jetpack_infinite_scroll_query_args' ); |
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
| // Add a custom user role | |
| $result = add_role( 'Contributor', __( | |
| 'Contributor' ), | |
| array( | |
| 'publish_posts' => false, // Allows the user to publish, otherwise posts stays in draft mode | |
| ) | |
| ); |
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
| /** | |
| Setelah fungsi mendapatkan hasil view post | |
| kemudian hasilnya berupa angka(count) | |
| jika lebih dari 1000 atau 100000 akan di konversi | |
| dengan fungsi round_numb() | |
| */ | |
| function get_viewcount(){ | |
| $view_ = (int) get_post_meta(get_the_ID(),'post_views_count', true); | |
| $conv_view = isset( $view_ ) ? round_numb( $view_ ) : $view_; | |
| echo " <div class='counter'>$conv_view</div>"; |
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
| /* | |
| Konversi angka, | |
| nah angka disini yaitu 1000 dan 1000000.. | |
| untuk angka 1000 menjadi 1K | |
| nah untuk 1000000 menjadi 1M | |
| */ | |
| // konversi | |
| function round_numb($totalshares){ | |
| if( $totalshares > 1000000 ) { | |
| $totalshares = round( $totalshares / 1000000, 1 ) . 'M'; |
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 | |
| //Pilihan_Atas : 11 | |
| //Pilihan_Bawah : 12 | |
| //Featured : 13 | |
| //Function mode | |
| // | |
| function the_category_filter($thelist,$separator='') { | |
| if(!defined('WP_ADMIN')) { | |
| //list exclude |
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 jetpack_infinite_scroll_query_args( $args ) { | |
| $args['order'] = 'ASC'; | |
| $args['orderby'] = 'name'; | |
| return $args; | |
| } | |
| add_filter( 'infinite_scroll_query_args', 'jetpack_infinite_scroll_query_args' ); |