WordPress.org

Forums

Parse error: syntax error, unexpected T_STRING (2 posts)

  1. Anouk
    Member
    Posted 9 months ago #

    I get an error on line 74 and I have searched a lot, but I can't find a solution. As far as I can see I haven't missed some ' or "? ..

    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/hmcc/domains/hmcc.nl-web.net/public_html/hst/wp-content/themes/HST/page-team.php on line 74

    The first line visible here is 70. The error is in the first 'echo' line.

    Any help is welcome!

    <ul class="team">
    <?php
        $pfportfolio = new WP_Query( 'post_type=ons_team' );
        while ( $pfportfolio->have_posts() ) : $pfportfolio->the_post();
            echo '<li data-id="post-' . get_the_ID() . '" data-type="<?php echo custom_taxonomy_terms_slugs( 'afdelingen' ); ?>">';
            echo '<div id="team-post">';
            echo '<div id="team-image"><img src="<?php the_field ('foto'); ?>" /></div>';
            echo '<div class="team-mail"><a href="mailto:<?php the_field ('e-mail'); ?>">EMAIL</a></div>';
            echo '<h2><?php the_field ('naam'); ?></h2>
        	      <?php the_field ('functie'); ?>';
        	echo ' </div> </div>';
            echo '</li>';
        endwhile;
        wp_reset_postdata();
    ?>
    </ul>
  2. vtxyzzy
    Member
    Posted 9 months ago #

    Your code is not consistent when entering and leaving php. And, I believe there is an extra </div>. Try this:

    <ul class="team">
    <?php
       $pfportfolio = new WP_Query( 'post_type=ons_team' );
       while ( $pfportfolio->have_posts() ) : $pfportfolio->the_post();
          echo '<li data-id="post-' . get_the_ID() . '" data-type="' . custom_taxonomy_terms_slugs( 'afdelingen' ) . '">';
             echo '<div id="team-post">';
                echo '<div id="team-image"><img src="' . the_field('foto') . '" /></div>';
                echo '<div class="team-mail"><a href="mailto:' . the_field('e-mail') . '">EMAIL</a></div>';
                echo '<h2>' . the_field('naam') . '</h2>';
                the_field('functie');
             echo ' </div>';
          echo '</li>';
       endwhile;
       wp_reset_postdata();
    ?>
    </ul>

Reply

You must log in to post.

About this Topic