• 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

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Is it a form the user is submitting, for the “if” part?

    Thread Starter posthawk

    (@posthawk)

    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

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    So you want to check if the form has been submitted?
    http://www.homeandlearn.co.uk/php/php4p7.html

    Thread Starter posthawk

    (@posthawk)

    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

    (@posthawk)

    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.