Title: How to code correctly
Last modified: August 20, 2016

---

# How to code correctly

 *  [posthawk](https://wordpress.org/support/users/posthawk/)
 * (@posthawk)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/how-to-code-correctly/)
 * I’m not quite sure how to code “if/else” statements
 * i want to make an “if” statement that states
 * > If (author has facebook/twitter/etc link filled out)
   > then (this code)
   > Else (Do Nothing)
 * but i cant understand “has” in the coding

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

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years, 4 months ago](https://wordpress.org/support/topic/how-to-code-correctly/#post-3370971)
 * Is it a form the user is submitting, for the “if” part?
 *  Thread Starter [posthawk](https://wordpress.org/support/users/posthawk/)
 * (@posthawk)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/how-to-code-correctly/#post-3370974)
 * no, the “form” is under the user setting, like email or nickname boxes which 
   i already have
 * im trying to make a sidebar widget that displays links to the users facebook 
   or whatever. which i have, but the problem is that it is displaying a facebook
   link even though they havent filled out the info
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years, 4 months ago](https://wordpress.org/support/topic/how-to-code-correctly/#post-3370983)
 * So you want to check if the form has been submitted?
    [http://www.homeandlearn.co.uk/php/php4p7.html](http://www.homeandlearn.co.uk/php/php4p7.html)
 *  Thread Starter [posthawk](https://wordpress.org/support/users/posthawk/)
 * (@posthawk)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/how-to-code-correctly/#post-3370990)
 * i’m looking for something more like this, but i cant quite get it
 * > $facebook = get_the_author_meta( ‘facebook’ );
   > if($facebook)
 *  Thread Starter [posthawk](https://wordpress.org/support/users/posthawk/)
 * (@posthawk)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/how-to-code-correctly/#post-3371002)
 * i need an if (user has posts) but i dont think a get_author_mets(‘Posts’) exists

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

The topic ‘How to code correctly’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [posthawk](https://wordpress.org/support/users/posthawk/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/how-to-code-correctly/#post-3371002)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
