Jump to content

richardfrank

New Members
  • Posts

    1
  • Joined

  • Last visited

richardfrank's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi It's ten years since I dabbled in php and mysql, but I have a problem with a Wordpress site that I look after for a friend which I think could be solved in five minutes of mysql... but it's far too long ago for me to remember how. So... I have an absolutely standard WP database and my task is to take a standard entry in post_content and extract some of it to go into post_excerpt. A typical post_content looks like this: [tab name=The Case]I saw this cat, with similar lesions in both eyes but comfortable and visually still, as a "Have a look at this while you are here" freebee examination in a clinic a few days ago. What are you seeing here?<a href="http://davidlwilliams.org.uk/wp-content/uploads/archivesite/pic523.jpg"><img class="aligncenter size-medium wp-image-532" title="© David Williams" src="http://davidlwilliams.org.uk/wp-content/uploads/archivesite/pic523.jpg" alt="" width="300" height="210" /></a>[/tab][tab name=David's view]This is lipid deposition with associated blood vessels probably after a corneal ulcer. We'd call this a lipid keratopathy, though I've never seen one in a cat before and can't find a report of it in the literature. Not enough money, or a calm enough cat, to take a blood sample for lipid analysis I'm afraid, but as the cat is happy no treatment is needed. If it were maybe the driver of this truck I passed on the way home from the consultation would be able to help!<a href="http://davidlwilliams.org.uk/wp-content/uploads/archivesite/pic524.jpg"><img class="aligncenter size-medium wp-image-532" title="© David Williams" src="http://davidlwilliams.org.uk/wp-content/uploads/archivesite/pic524.jpg" alt="" width="300" height="210" /></a>[/tab][end_tabset] I want to get rid of the first shortcode (i.e. everything between the opening [ ] and then extract the next 20 words... add on a "..." and put it into the post_excerpt field. Probably not difficult... but it is for me ten years on (and feeling decidedly middle-aged)! ALSO, what's the best method for trying a solution out without potentially trashing a database? Would hugely appreciate any help. Richard
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.