Title: Question about code
Last modified: February 7, 2017

---

# Question about code

 *  [gregsbaby64](https://wordpress.org/support/users/gregsbaby64/)
 * (@gregsbaby64)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/question-about-code/)
 * Hi,
    I have a page here [here](http://www.floopie.com/) that pulls in the last
   10 posts from 2 of my blogs. The titles have slashes in them. It’s not the WP
   code, but the code I used to pull them in. I think. Here’s the code: `Last 10
   recipes:`
 *  <?php $wpcook = $wpdb->get_results("SELECT ID, post_title FROM wpcookposts WHERE
   post_status = 'publish' order by post_date desc limit 10");
    foreach ($wpcook
   as $v) { echo " ID."'>" . $v->post_title . " "; } ;?> Any help in getting rid
   of the slashes would be great. I tried to put stripslashes in the code, but no
   luck. Thanks, Sara 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Joshua Sigar](https://wordpress.org/support/users/alphaoide/)
 * (@alphaoide)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/question-about-code/#post-115376)
 * [http://wiki.wordpress.org/?pagename=get_posts](http://wiki.wordpress.org/?pagename=get_posts)
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/question-about-code/#post-115388)
 * You could try this right after you start the foreach:
    `stripslashes($v);`
 *  [Joshua Sigar](https://wordpress.org/support/users/alphaoide/)
 * (@alphaoide)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/question-about-code/#post-115389)
 * Why not?
    Anyhow, there are some “recent posts” plugins/hacks in wiki, might 
   want to take a look at it
 *  Thread Starter [gregsbaby64](https://wordpress.org/support/users/gregsbaby64/)
 * (@gregsbaby64)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/question-about-code/#post-115390)
 * Thanks Kafkaesqui. Where would I put that?
 *  Thread Starter [gregsbaby64](https://wordpress.org/support/users/gregsbaby64/)
 * (@gregsbaby64)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/question-about-code/#post-115396)
 * Alphaoide, I have the recent plugins on my blog. I want to accomplish something
   different for the front page.
 *  Thread Starter [gregsbaby64](https://wordpress.org/support/users/gregsbaby64/)
 * (@gregsbaby64)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/question-about-code/#post-115412)
 * Thanks for the code…still doesn’t work though. 🙁
 *  [Cypher](https://wordpress.org/support/users/cypher/)
 * (@cypher)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/question-about-code/#post-115425)
 * For grins..try:
    ` stripslashes($v->post_title);  Regards

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Question about code’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 4 participants
 * Last reply from: [Cypher](https://wordpress.org/support/users/cypher/)
 * Last activity: [21 years, 4 months ago](https://wordpress.org/support/topic/question-about-code/#post-115425)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
