41. Get the term list for an object
<?php
echo get_the_term_list(
$post->ID,
'$term',
'[before list]',
'[between each item]',
'[after list]' );
?>
42. Get the term list for an object
<?php
echo get_the_term_list(
$post->ID,
'aktivitet',
'',
' ',
'' );
?>
43. Get the term list for an object
<?php
echo "<ul>";
echo get_the_term_list(
$post->ID,
'aktivitet',
'<li>',
'</li><li>',
'</li>' );
echo "</ul>";
?>
59. Anything WordPress can do I
can do too
In this case
<?php
add_action('publish_soknad', 'check_term_changes', 10, 2);
function check_term_changes($post_id, $post){
$terms = wp_get_object_terms($post_id, $taxonomy);
switch($term_id) {
case $term_id == $status_terms['post_likes']:
$sms_message = message;
break;
update_post_meta($post_id, '_prev_status', $term_id);
}
?>
60. Bonus 1
Get (and fix) URL from a custom field
<?php
if ((get_post_meta($post->ID, 'website', true))) {
$websiteURL = get_post_meta($post->ID, 'website', true);
if (substr($websiteURL,0,7) != 'http://') {
$websiteURL = 'http://' . $websiteURL;
}
?>
<a href="<?php echo $websiteURL ?>“ title="Website">
The Website
</a>
<?php } ?>