Title: Code verification
Last modified: August 20, 2016

---

# Code verification

 *  Resolved [Jay](https://wordpress.org/support/users/fectio1/)
 * (@fectio1)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/code-verification/)
 * Im trying to display the content if it is available and if not it displays “more
   info coming soon”
 * Is this right? It works, I just want to make sure it is the correct way and most
   efficient.
 *     ```
       <?php if($content = $post->post_content ) {
         echo "<span class='titles'>Description:";
         echo "</span>";
         echo the_content();
       } else {
        echo "<span class='titles'>More Info Coming Soon</span>";
       } ?>
       ```
   
 * thanks

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

 *  Thread Starter [Jay](https://wordpress.org/support/users/fectio1/)
 * (@fectio1)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/code-verification/#post-2526029)
 * does this mean its right?
 *  [Tim S](https://wordpress.org/support/users/tim-s/)
 * (@tim-s)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/code-verification/#post-2526036)
 * The code looks clean, if it works then I’d say use it. Every developer codes 
   differently, but your code looks clean.
 *  Thread Starter [Jay](https://wordpress.org/support/users/fectio1/)
 * (@fectio1)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/code-verification/#post-2526037)
 * Thank you!
 *  [Tim S](https://wordpress.org/support/users/tim-s/)
 * (@tim-s)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/code-verification/#post-2526044)
 * No worries! Take care!
 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/code-verification/#post-2526046)
 * This is wrong syntax:
 *     ```
       if($content = $post->post_content )
       ```
   
 * You’re _setting_ `$content` equal to `$post->post_content`, and thus your conditional
   will _always_ be true.
 * Try this instead:
 *     ```
       if( $content == $post->post_content )
       ```
   
 *  [Tim S](https://wordpress.org/support/users/tim-s/)
 * (@tim-s)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/code-verification/#post-2526047)
 * Chip good catch! I should’ve caught that earlier!
 *  Thread Starter [Jay](https://wordpress.org/support/users/fectio1/)
 * (@fectio1)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/code-verification/#post-2526049)
 * I changed it to this
 * `if($content = $post->post_content !='' )`
 * Thanks!
 *  Thread Starter [Jay](https://wordpress.org/support/users/fectio1/)
 * (@fectio1)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/code-verification/#post-2526054)
 * and now this
 * `if($post->post_content !='' )`

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

The topic ‘Code verification’ is closed to new replies.

## Tags

 * [get_content](https://wordpress.org/support/topic-tag/get_content/)
 * [if statement](https://wordpress.org/support/topic-tag/if-statement/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 3 participants
 * Last reply from: [Jay](https://wordpress.org/support/users/fectio1/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/code-verification/#post-2526054)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
