else { echo ''; } ?> , is there an error?

Discussion in 'PHP' started by Proficient, May 3, 2009.

  1. #1
    I get this:

    atal error: Call to undefined function the_content_limit() in /home/mdub/public_html/forumsuccess.net/wp-content/themes/Basic/includes/default.php on line 19

    And the 19th line is:

    <?php } (18th)
    else { echo ''; } ?> (19th)

    Is there spacing probs or somthing?
     
    Proficient, May 3, 2009 IP
  2. dannywwww

    dannywwww Well-Known Member

    Messages:
    804
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    110
    #2
    Has the function the_content_limit() been declared?
     
    dannywwww, May 3, 2009 IP
  3. hiteklife

    hiteklife Greenhorn

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    would it be alright to see the entire contents of the "IF" statement? Would probably help a lot. I often get things like this if I add an if statement into the middle of some code and either forget a } or have too many }'s :) I could probably tell you more with a bit more code.
     
    hiteklife, May 3, 2009 IP
  4. Sapphiro

    Sapphiro Well-Known Member

    Messages:
    1,242
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    175
    #4
    you need to have a "IF" before having an "else". :)
     
    Sapphiro, May 4, 2009 IP
  5. emp

    emp Active Member

    Messages:
    99
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    61
    #5
    Yes, no use if we can't see the whole if-then statement.

    Obscure the variable names or values if you must. So instead of writing

    if ($url=="myhomepage.com")
    {...}

    just write

    if ($url=="yawish, right?")
    {...}

    ::emp::
     
    emp, May 4, 2009 IP
  6. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #6
    You are trying to use a function: the_content_limit that isn't declared. Declare it like:

    function the_content_limit(){ // the code }

    Peace,
     
    Barti1987, May 4, 2009 IP
  7. Ecreation

    Ecreation Active Member

    Messages:
    823
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    68
    #7
    Ecreation, May 4, 2009 IP