• Hello to every one,
    when I insert PHP code in the template file, returns an error.
    I wonder why, do you have some ideas about?
    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • To get help, you need to tell about the error message and what the code is you are trying to insert for what reason.

    I would recommend you work in a Child Theme. It makes it very easy to make changes and recover the site if you make a horrible mistake.

    Thread Starter FeliceAntonio

    (@antonio_09)

    I’m working on file in the child theme.
    In header.php into the child theme, I add the breadcrumb code at the end of the page, on line 367:

    </header><!-- #site-header -->
    
    <?php
    if ( function_exists('yoast_breadcrumb') ) {
      yoast_breadcrumb( '<p id="breadcrumbs">','</p>' );
    }
    ?>

    and return the error on line 184:

    Parse error: syntax error, unexpected ';' in /home/aproposi/public_html/wp-content/themes/twentytwenty-child/header.php on line 184

    It is good that you are working in a child theme. What happens if you remove that code? Do you still get the error? Does the parent theme work correctly?

    I looked at the header.php in the theme and don’t see why you are getting the error on that particular line. It may be that you have made other changes to the file and the combination of changes has made the error arise.

    I am afraid that I don’t have the knowledge to find the error. I was hoping that you hadn’t changed the theme’s files and you can get the original theme to work as expected. I hope that someone with more expertise will be able to help you now.

    Thread Starter FeliceAntonio

    (@antonio_09)

    However, thanks for your time -:)

    Someone else may take up the challenge. I am sorry I cannot help you immediately.

    Thread Starter FeliceAntonio

    (@antonio_09)

    Sorry,
    I ask to a moderator if is possible to corrige this post, I wrong to add all the code, I would ask you to delete all the string before wp-content/themes/twentytwenty-child/header.php on line 184
    Thanks.

    Thread Starter FeliceAntonio

    (@antonio_09)

    However, for the breadcrumb, I added this code in functions.php child theme, and into it the breadcrumb code.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Sorry, why was this topic tagged with modlook?

    Thread Starter FeliceAntonio

    (@antonio_09)

    I wonder why.

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

The topic ‘Php code in template file returs error’ is closed to new replies.