-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_post_meta.php
More file actions
31 lines (24 loc) · 912 Bytes
/
get_post_meta.php
File metadata and controls
31 lines (24 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/*
/*
/* 3 parameters
/* Post ID = $post->ID or get_the_ID()
/* Identifier = An Unique ID of the custom field
/* single value or multiple value will return? single value= true
/* double value = flase and we have to put array
/*
*/
echo get_post_meta(get_the_ID(), 'skill_percentage', true);
// we should have a custom field named 'skill_percentage' in the post/page edit area
// LWHH
$placeholder_text = get_post_meta(get_the_ID(),"placeholder",true);
$button_label = get_post_meta(get_the_ID(),"button label",true);
$hint = get_post_meta(get_the_ID(),"hint",true);
?>
<div class="form-group">
<input type="text" class="form-control" placeholder="<?php echo esc_attr($placeholder_text); ?>">
<input type="submit" value="<?php echo esc_attr($button_label); ?>" class="btn btn-primary">
<p class="tip">
<?php echo esc_html($hint); ?>
</p>
</div>