0

I am facing a problem while coding. Trying to develop a theme. But an error is showing in the screen just like the attached screenshot. Code is attached here. Can anyone help me out there?

enter image description here

in functions.php

<?php

function launcher_setup_theme(){
    load_theme_textdomain('launcher');
    add_theme_support('post-thumbnail');
    add_theme_support('title-tag');
}

add_action('after_setup_theme','launcher_setup_theme');

function launcher_assets(){
    //**Enqueue CSS */
    wp_enqueue_style('launcher',get_stylesheet_uri());
    wp_enqueue_style('animate-css',get_theme_file_uri('/assets/css/animate.css'));
    wp_enqueue_style('bootstrap-css',get_theme_file_uri('/assets/css/bootstrap.css'));
    wp_enqueue_style('bootstrap-css-map',get_theme_file_uri('/assets/css/style.css'));
    wp_enqueue_style('icomoon-css'.get_theme_file_uri('/assets/css/icomoon.css'));



    //** Enqueue JS */
    wp_enqueue_scripts('easing-jquery-js',get_theme_file_uri('/assets/js/jquery.easing.1.3.js'),
    array('jquery'),null,true);
    wp_enqueue_scripts('waypoints-jquery-js',get_theme_file_uri('/assets/js/jquery.waypoints.min.js'),array('jquery'),null,true);
    wp_enqueue_scripts('bootstrap-jquery-js',get_theme_file_uri('/assets/js/bootstrap.min.js'),array('jquery'),null,true);
    wp_enqueue_scripts('countdown-jquery-js',get_theme_file_uri('/assets/js/simplyCountdown.js'),array('jquery'),null,true);
    wp_enqueue_scripts('main-js',get_theme_file_uri('/assets/js/main.js'),array('jquery'),null,true);

}

add_action('wp_enqueue_scripts','launcher_assets');




function launcher_sidebars_left(){
    //**
    register_sidebar( array(
        'name'          => __( 'Footer Right', 'launcher' ),
        'id'            => 'footer-right',
        'description'   => __('Footer','launcher'),
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget'  => '</li>',
        'before_title'  => '<h2 class="widgettitle">',
        'after_title'   => '</h2>',
    ) );
    }
    function launcher_sidebars_right(){

register_sidebar( array(
    'name'          => __( 'Footer Left', 'launcher' ),
    'id'            => 'footer-left',
    'description'   => __('Footer','launcher'),
    'before_widget' => '<li id="%1$s" class="text right widget %2$s">',
    'after_widget'  => '</li>',
    'before_title'  => '<h2 class="widgettitle">',
    'after_title'   => '</h2>',
) 
    );
}

add_action('widgets_init','launcher_sidebars_right');
add_action('widgets_init','launcher_sidebars_left');

in index.php

<?php 
the_post();
get_header(); ?>

<body>
<div class="fh5co-loader"></div>

<aside id="fh5co-aside" role="sidebar" class="text-center" style="background-image: url(images/img_bg_1_gradient.jpg);">
    <h1 id="fh5co-logo"><a href="<?php echo site_url(); ?>"><?php bloginfo('name'); ?></a></h1>
</aside>

<div id="fh5co-main-content">
    <div class="dt js-dt">
        <div class="dtc js-dtc">
            <div class="simply-countdown-one animate-box" data-animate-effect="fadeInUp"></div>

            <div class="row">
                <div class="col-md-12">
                    <div class="row">
                        <div class="col-lg-7">
                            <div class="fh5co-intro animate-box">
                                <h2><?php the_title(); ?></h2>
                                <?php the_content();  ?>
                        </div>
                        
                        <div class="col-lg-7 animate-box">
                            <form action="#" id="fh5co-subscribe">
                                <div class="form-group">
                                    <input type="text" class="form-control" placeholder="Enter your email">
                                    <input type="submit" value="Send" class="btn btn-primary">
                                    <p class="tip">Please enter your email address for early access.</p>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
                
        </div>
    </div>

    <div id="fh5co-footer">
        <div class="row">
            <div class="col-md-6">


                    <?php 
                    if(is_active_sidebar('footer-left')){
                        dynamic_sidebar('footer-left');
                    }
                    footer-left
                    ?>

            </div>
            <div class="col-md-6 fh5co-copyright">

             
             <?php
                if(is_active_sidebar('footer-right')){
                    dynamic_sidebar('footer-right');
                } 
                
                ?>


            </div>
        </div>
    </div>
    
</div>

<?php get_footer(); ?>  

1 Answer 1

0

Wow, there's a lot of extra code and warnings here that we can ignore, but I think you might be missing the very beginning of your functions.php code. If not, and that's the whole block of code in question, then you're missing one or more opening parentheses at the beginning of that php snippet. That's also what that error means sometimes.

It's almost like an infinite loop. The code is missing a bracket or parenthesis or both so most, if not all, of those errors are being thrown by WP because WP is expecting to see something else which is either an opening or closing bracket, but instead is finding more functions, variables, and other code where it thinks it shouldn't be.

Looking at the beginning of your functions.php code, there is 1 open parenthesis missing from what I can see. If that is all the code in functions.php, it should start like this:

__(( 'Footer Right', 'launcher' ), 'id' => 'footer-right', 'description' => __('Footer','launcher'), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', ) );

Again, I'm guessing that's not all the code since there's the 2 underscores at the beginning, usually denoting that there's another line of code above that. Is it just the standard default functions.php code that comes with WP above that?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.