Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

rexsorgatz on "Extract Post Content into Custom Field"

$
0
0

Hard one:

I have a site with thousands of posts that contain a hard-coded subhead at the top of the body content. That is, every posts starts something like this:

<h2>Specific subhead related to this post</h2><p>Here is where the post starts...</p>

I would like to extract that data ("Specific subhead related to this post") from the post content and place it into a custom field instead. Some variation of Regex and SQL is likely required, but it would be helpful if there were some code base I start from...


Viewing all articles
Browse latest Browse all 8245

Trending Articles