Skip to content

Instantly share code, notes, and snippets.

View rajendra89's full-sized avatar

Rajendra Rijal rajendra89

View GitHub Profile
@rajendra89
rajendra89 / custom-field.php
Created June 1, 2017 05:52
WordPress Custom Fields
<?php
$meta_value=get_post_meta($post->ID,'views',true);
//get_post_meta( int $post_id, string $key = '', bool $single = false ))
if(!empty($meta_value)){
echo $meta_value;
}
?>
@rajendra89
rajendra89 / my-first-custom-element
Created August 9, 2017 07:17
replace your my-first-custom-element.php with code below.
replace your my-first-custom-element.php with code below.
<div class="modal fade" id="custdetail" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title" id="myModalLabel">More About Joe</h4>
</div>
<div class="modal-body">