• Resolved aprtmike

    (@aprtmike)


    Hello,
    could some one help me out, I am wanting to add a logo upload to the customizer.
    When I add the code to my functions file I get this error message.

    Parse error: syntax error, unexpected ‘<‘ in /homepages/26/d615387993/htdocs/clickandbuilds/CircleofMotherEarth/wp-content/themes/twentysixteen-child/functions.php on line

    <?php
    /**
     * Add logo without Jetpack
     */
    
    add_action( 'init', 'storefront_custom_logo' );
    function storefront_custom_logo() {
    remove_action( 'storefront_header', 'storefront_site_branding', 20 );
    add_action( 'storefront_header', 'storefront_display_custom_logo', 20 );
    }
    
    function storefront_display_custom_logo() {
    ?>
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="site-logo-link" rel="home">
    <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png" alt="<?php echo get_bloginfo( 'name' ); ?>" />
    </a>
    <?php
    }

    link to my site

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter aprtmike

    (@aprtmike)

    I believe this error refers to the top line in your code snippet. the <?php and ?> are indicators of where php code begins and ends. You cannot have two <?php without somewhere in-between having a ?>. The solution is likely to remove a duplicated <?php from your functions.php file.

    If you feel I’m wrong, please use https://wpbin.io to post your full functions.php file and copy the link to your post into a reply here so that somebody can have a more in-depth look.

    Thread Starter aprtmike

    (@aprtmike)

    Hi Daniel,
    Thank you so much for your quick response, I did remove the duplicated <?php and I am still getting the error. I have pasted my functions file in wpbin.

    Here is the link
    https://wpbin.io/3uwi9t

    Parse error: syntax error, unexpected end of file in /homepages/26/d615387993/htdocs/clickandbuilds/CircleofMotherEarth/wp-content/themes/twentysixteen-child/functions.php on line 38

    Thread Starter aprtmike

    (@aprtmike)

    Thanks again, Daniel I have it now.
    Cheers

    Just needed to type the code out into a new functions file and upload it. After removing the duplicated tag.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Parse error: syntax error’ is closed to new replies.