Parse Error

Discussion in 'PHP' started by leaseman, Jan 31, 2012.

  1. #1
    I've read every post I can find but I just can't figure this out. Here's the error:


    Parse error: syntax error, unexpected '<' in /home/content/23/8175723/html/wp-content/themes/thesis_182/custom/custom_functions.php on line 24

    Can someone point this out. Here's the code:

    <?php
    /* By taking advantage of hooks, filters, and the Custom Loop API, you can make Thesis
     * do ANYTHING you want. For more information, please see the following articles from
     * the Thesis User’s Guide or visit the members-only Thesis Support Forums:
     * 
     * Hooks: http://diythemes.com/thesis/rtfm/customizing-with-hooks/
     * Filters: http://diythemes.com/thesis/rtfm/customizing-with-filters/
     * Custom Loop API: http://diythemes.com/thesis/rtfm/custom-loop-api/
    
    ---:[ place your custom code below this line ]:---*/
    
    function hide_headline() { 
    if (is_page()) 
    return false; // Do not show headline 
    else 
    return true; // Show headline 
    } 
    
    add_filter('thesis_show_headline_area', 'hide_headline'); 
    
    remove_action('thesis_hook_before_header', 'thesis_nav_menu');
    add_action('thesis_hook_after_header', 'thesis_nav_menu');
    Code (markup):
     
    leaseman, Jan 31, 2012 IP
  2. Shiplu

    Shiplu Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This code has no problem. But I think problem lies in one of these functions

    
    add_filter('thesis_show_headline_area', 'hide_headline'); 
    remove_action('thesis_hook_before_header', 'thesis_nav_menu');
    add_action('thesis_hook_after_header', 'thesis_nav_menu')
    
    Code (markup):
    Could you send the body of these functions too?
     
    Shiplu, Jan 31, 2012 IP
  3. leaseman

    leaseman Greenhorn

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    Forgive my ignorance but the above code is everything in the "custom_functions.php" file (Wordpress). What is it that I need to provide?
     
    leaseman, Jan 31, 2012 IP
  4. UK PHP Media

    UK PHP Media Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    PHP closing tag ( ?> ) is missing.
     
    UK PHP Media, Jan 31, 2012 IP
  5. leaseman

    leaseman Greenhorn

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #5
    Where does it go?
     
    leaseman, Jan 31, 2012 IP
  6. UK PHP Media

    UK PHP Media Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Last line of your script.
     
    UK PHP Media, Jan 31, 2012 IP
  7. leaseman

    leaseman Greenhorn

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #7
    I tried that and got the same error
     
    leaseman, Jan 31, 2012 IP
  8. aidanriley

    aidanriley Banned

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    51
    #8
    Paste line 24, or all of that file (custom_functions.php), please.
     
    aidanriley, Jan 31, 2012 IP
  9. leaseman

    leaseman Greenhorn

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #9
    The code I pasted above is the entire file.
     
    leaseman, Jan 31, 2012 IP
  10. aidanriley

    aidanriley Banned

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    51
    #10
    Did you add ?> to the end (without parentheses)?
     
    aidanriley, Jan 31, 2012 IP
  11. lonelygrit

    lonelygrit Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Parse error: syntax error, unexpected '<' in /home/content/23/8175723/html/wp-content/themes/thesis_182/custom/custom_functions.php on line 24
    error on line 24 but you post only 22 lines :D so funny
     
    lonelygrit, Feb 1, 2012 IP
  12. leaseman

    leaseman Greenhorn

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #12
    exactly! Why would it specify line 24 when there are only 22 lines of code?
     
    leaseman, Feb 1, 2012 IP
  13. UK PHP Media

    UK PHP Media Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    It does not.
     
    UK PHP Media, Feb 1, 2012 IP