Title: functions.php corrupt
Last modified: August 21, 2016

---

# functions.php corrupt

 *  Resolved [Bielco](https://wordpress.org/support/users/bielco/)
 * (@bielco)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/functionsphp-corrupt/)
 * the brightnews/functions.php seems to be corrupt…
 * on line 68 there is a php if construction that is not valid….
 *     ```
       function brightnews_scripts_styles() {
       	global $wp_styles;
       	// Adds JavaScript
       	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
       }
       ```
   
 * This is not a valid if construction and when you use an ide that reports…
 * expecting statement, which is correct.
 * Furthermore on line 369 there is this code…
 *     ```
       function brightnews_button_shortcode($atts, $content = null) {
          extract(shortcode_atts(array('link' => '#'), $atts));
          return '<a class="custom-button" href="'.$link.'">' . do_shortcode($content) . '</a>';
       }
       ```
   
 * $link is not available in the function, you can fix this by passing the link 
   to the function, or to call global $link in the function.

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

 *  Theme Author [TT Themes](https://wordpress.org/support/users/tomastoman/)
 * (@tomastoman)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/functionsphp-corrupt/#post-4803751)
 * Dear Bielco,
 * the first code (on line 68) is used for calling the comment-reply script for 
   threaded comments:
 *     ```
       if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
       		wp_enqueue_script( 'comment-reply' );
       ```
   
 * There are more possibilities how to define a condition in PHP and this is one
   of the solutions. You can see the same construction also in Twenty Twelve theme(
   for example).
 * The second code is used for custom button shortcode. As this feature is rather
   plugin than theme territory, I am considering to remove it with the future updates.
   But as you can see in the [Codex](http://codex.wordpress.org/Shortcode_API), 
   this solution is fully functional.
 * In any case, thank you for your notices!
    Tomas Toman
 *  Thread Starter [Bielco](https://wordpress.org/support/users/bielco/)
 * (@bielco)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/functionsphp-corrupt/#post-4803765)
 * Ah that makes sense, thanks for the reply.
 *  Theme Author [TT Themes](https://wordpress.org/support/users/tomastoman/)
 * (@tomastoman)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/functionsphp-corrupt/#post-4803798)
 * You’re welcome!

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

The topic ‘functions.php corrupt’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/brightnews/1.3.3/screenshot.png)
 * BrightNews
 * [Support Threads](https://wordpress.org/support/theme/brightnews/)
 * [Active Topics](https://wordpress.org/support/theme/brightnews/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/brightnews/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/brightnews/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [TT Themes](https://wordpress.org/support/users/tomastoman/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/functionsphp-corrupt/#post-4803798)
 * Status: resolved