Support » Theme: BrightNews » functions.php corrupt

  • Resolved Bielco


    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


    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, this solution is fully functional.

    In any case, thank you for your notices!
    Tomas Toman

    Ah that makes sense, thanks for the reply.

    Theme Author TT Themes


    You’re welcome!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘functions.php corrupt’ is closed to new replies.