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 Post Type Pegawai | |
* | |
* @package WordPress | |
* @subpackage Latihan | |
* @since Latihan 1.0 | |
*/ | |
?> | |
<?php |
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 | |
if ( ! function_exists( 'datediff' ) ) { | |
function datediff($tgl1, $tgl2){ | |
$tgl1 = strtotime($tgl1); | |
$tgl2 = strtotime($tgl2); | |
$diff_secs = abs($tgl1 - $tgl2); | |
$base_year = min(date("Y", $tgl1), date("Y", $tgl2)); | |
$diff = mktime(0, 0, $diff_secs, 1, 1, $base_year); | |
return array( | |
"years" => date("Y", $diff) - $base_year, |
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 button( $atts ) { | |
$atts = shortcode_atts( array( | |
'type' => 'button', | |
'href' => '', | |
'class' => 'button', | |
'target' => '_blank' | |
), $atts ); | |
if( $atts['href'] == true ) { | |
return '<a href="'.$atts['href'].'" class="'.$atts['class'].'" target="'.$atts['target'].'">Button !</a>'; |
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 | |
$args = array( | |
'post_type' => 'post', | |
'post_status' => 'publish', | |
'meta_key' => 'tanggal_lahir', //id | |
'orderby' => 'meta_value', | |
'order' => 'DESC', | |
); | |
$wp_query = new WP_Query(); | |
$wp_query->query( $args ); |
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 | |
// Select taxonmony | |
$taxonomies = array( | |
'kb_category', | |
); | |
// Filter taxonomy | |
$args = array( | |
'hide_empty' => false, | |
); |
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 while( $wp_query->have_posts() ): $wp_query->the_post(); | |
if ($wp_query->current_post % 2 == 0): | |
//odd | |
else: | |
//even | |
endif | |
endwhile | |
?> |
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 to display post meta | |
* | |
* @package WordPress | |
* @subpackage My Theme | |
* @since My Theme 1.0.0 | |
*/ | |
if ( ! function_exists( 'my_post_meta' ) ) { | |
function my_post_meta() { |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<!-- Example --> | |
<form action=""> | |
<input type="number" name="quantity" min="1" max="5"> | |
<input type="date" /> | |
<input type="time" /> | |
<input type="month" /> |
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 | |
/** | |
* Shortcodes Article Category | |
* Untuk menampilkan semua category article dengan categorynya masing2 (di dlm tiap2 category article ada categorynya masing2) | |
* @package WordPress | |
* @subpackage Lat | |
* @since Lat 1.0.0 | |
*/ | |
//shortcodes Category |
OlderNewer