• Hello— attempting to remove the header from a specific page I inserted code from a wordpress twenty twelve thread into my child theme functions.php editor. Doing so has led me to, Parse error: syntax error, unexpected ‘<‘ in /home/charlieb/public_html/wp/wp-content/themes/twentytwelve-child/functions.php on line 9

    removing this code from the editor does not bring my site back. Please advise. Thank you

Viewing 14 replies - 1 through 14 (of 14 total)
  • what is the full code of your child theme’s functions.php ?

    Thread Starter Chip G.

    (@chip-g)

    ? Other tha posted text what specifically should I look for?

    Parse error: syntax error, unexpected ‘<‘ in /home/charlieb/public_html/wp/wp-content/themes/twentytwelve-child/functions.php on line 9

    please post the full code of your child theme’s functions.php file, so somebody can check where the error is.

    you might have added a new php tag where one was already open (?)

    Thread Starter Chip G.

    (@chip-g)

    Hello— I recognize in the code is_page(id=443) is what I added and obviously incorrect. What should be between the parenthesis to get me back to initial order?

    <?php
    // Exit if accessed directly
    if ( !defined('ABSPATH')) exit;
    
    /* Add custom functions below */
    remove_action( 'woocommerce_pagination', 'woocommerce_catalog_ordering', 20 );
    
    <?php $header_image = get_header_image();
    if ( ! empty( $header_image ) && is_page(id=443) ) : ?>
    	<a>"><img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
    <?php endif; ?>
    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you re-post that? The above code was corrupted by the forum’s parser. Remember to wrap your code in backticks.

    Thread Starter Chip G.

    (@chip-g)

    <?php
    // Exit if accessed directly
    if ( !defined('ABSPATH')) exit;
    
    /* Add custom functions below */
    remove_action( 'woocommerce_pagination', 'woocommerce_catalog_ordering', 20 );
    
    <?php $header_image = get_header_image();
    if ( ! empty( $header_image ) && is_page(id=443) ) : ?>
    	<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
    <?php endif; ?>
    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    That’s corrupted again, can you instead post it on PasteBin and share us a link to that?
    https://pastebin.com

    Thread Starter Chip G.

    (@chip-g)

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Okay so I can see a syntax error here:

    <?php $header_image = get_header_image();

    Do you see that you don’t need to open PHP here, you don’t need this bit:

    <?php

    Thread Starter Chip G.

    (@chip-g)

    Yes, I see and understand to remove that bit. But, I did add the (id=443) Shouldn’t that be changed to what it was initially?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Try remove the “id=” bit

    Thread Starter Chip G.

    (@chip-g)

    Okay, I’m back up to where I started. I thank you Andrew.

    Should I begin a new thread to learn how to remove the header from only 1 page of my site?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    That’ll probably increase the likelihood that you’ll receive help, yes ??

    Thread Starter Chip G.

    (@chip-g)

    Okay. Again, thank you for your troubleshooting.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Twenty Twelve Parse Error’ is closed to new replies.