Skip to content

Instantly share code, notes, and snippets.

@badcrocodile
Created August 26, 2013 19:37
Show Gist options
  • Save badcrocodile/6345674 to your computer and use it in GitHub Desktop.
Save badcrocodile/6345674 to your computer and use it in GitHub Desktop.
<?php
// To wrap it up, lets add our custom field values to the body content of the post so Wordpress search can pick them up (it doesn't include custom fields in search).
$new_content = "<h1>$post->post_title</h1>";
$new_content .= "<div id=\"expertise_in\">";
$new_content .= "<div class=\"category_list\"><h2>Expertise:</h2>";
$new_content .= $return;
$new_content .= "</div>";
$new_content .= "<div class=\"tag_list\"><h3>Other topics listed:</h3>";
$new_content .= $misc_topics;
$new_content .= "</div>";
$new_content .= "</div>";
$post->post_content .= $new_content;
wp_update_post($post);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment