Home>

The following warning came out by increasing the version of php from 5 to 7.
I haven't forgotten to add undefined or single quotes to php, so I'm not sure why.

use of undefined constant php-assumed 'php' (this will throw an error in a future version of php) archive.php on line 1

Thank you for helping me to eliminate this error.

About sorcecode

<? php/*
Template Name: Archive
* /
?>
<? php get_header ();?>
    <main<? php post_class ();?>>
    <? php
    $categories = get_the_category ();
        $tags = get_the_tags ();
    ?>
    <header>
    <div>
        <? php echo category_description ();?>
            <nav>
            </nav>
        </div><!-END-header_layer->
    </header>
    <section>
        <h1><? php the_archive_title ('Column for' ',' ');?></h1>
        <div>
    <? php
      if (have_posts ()):/* if (have_posts ()): */while (have_posts ()): the_post ();?>
      <div>
        <a href = "<? php the_permalink ();?>">
        <? php the_post_thumbnail ();?>
        </a>
        <div>
          <h2><a href = "<? php the_permalink ();?>"><? php the_title ();?></a></h2>
          <p><? php the_time ('Y/n/j');?></p>
        </div>
        <div><? php the_excerpt ();?></div>
      </div>
    <? php endwhile;?>
      <? php
        endif;
        wp_reset_postdata ();
      ?>
      <div>
        <ul>
          <? php if (function_exists ("pagination")) {
      pagination ($additional_loop->max_num_pages);
    }?>
        </ul>
     </div>
      </div>
    </div>
  </section>
</main>
<? php get_footer ();?>
  • Answer # 1

    Well, it looks like I ’m looking into it

    This type of error usually needs to be quoted here, but it's correct
    Since the target is php, there is a high possibility that the php tag is wrong.