Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Parse error: syntax error, unexpected '}' on last line

<?php $value = get_field( "fjern_produktinfo" );

if( $value ) { ?>

<h3><?php the_field('produkt_navn') ?></h3>
<?php the_field ('beskrivelse') ?>

<?php } else { ?>
<ul class="prod-list">
<?php if( get_field('produkt_navn') ): ?><li><h3><?php the_field('produkt_navn'); ?></h3></li><?php endif; ?>
<?php if( get_field('vare_nr') ): ?><li><strong>Item no:</strong> <?php the_field('vare_nr'); ?></li><?php endif; ?>
<?php if( get_field('content') ): ?><li><strong>Content:</strong> <?php the_field('content'); ?></li><?php endif; ?>
<?php if( get_field('contant_oz') ): ?><li><strong>Contant Oz.:</strong> <?php the_field('contant_oz'); ?></li><?php endif; ?>
<?php if( get_field('weight') ): ?><li><strong>Weight:</strong> <?php the_field('weight'); ?></li><?php endif; ?>
<?php if( get_field('amount_per_parcel') ): ?><li><strong>Amount per. Parcel:</strong> <?php the_field('amount_per_parcel'); ?></li><?php endif; ?>
<?php if( get_field('parcel_colli') ): ?><li><strong>Parcel in a colli::</strong> <?php the_field('parcel_colli'); ?></li><?php endif; ?>
<?php if( get_field('total_in_a_colli_minimum_order') ): ?><li><strong>Total in a colli Minimum order:</strong> <?php the_field('total_in_a_colli_minimum_order'); ?></li><?php endif; ?>
<?php if( get_field('stackable') ): ?><li><strong>Stackable:</strong> <?php the_field('stackable'); ?></li><?php endif; ?>
<?php if( get_field('inner_box_ean_barcode') ): ?><li><strong>Inner box - EAN/Barcode:</strong> <?php the_field('inner_box_ean_barcode'); ?></li><?php endif; ?>
<?php if( get_field('type') ): ?><li><strong>Type:</strong> <?php the_field('type'); ?></li><?php endif; ?>
<?php if( get_field('color') ): ?><li><strong>Color:</strong> <?php the_field('color'); ?></li><?php endif; ?>
<?php if( get_field('size') ): ?><li><strong>Size:</strong> <?php the_field('size'); ?></li>?php endif; ?>
<?php if( get_field('bottom_logo') ): ?><li><strong>Bottom Logo:</strong> <?php the_field('bottom_logo'); ?></li><?php endif; ?>
<?php if( get_field('mark_line') ): ?><li><strong>Mark line (cl):</strong> <?php the_field('mark_line'); ?></li><?php endif; ?>
<?php if( get_field('box_size') ): ?><li><strong>Box size:</strong> <?php the_field('box_size'); ?></li><?php endif; ?>
<?php if( get_field('box_nw') ): ?><li><strong>Box N.W:</strong> <?php the_field('box_nw'); ?></li><?php endif; ?>
<?php if( get_field('box_gw') ): ?><li><strong>Box G.W:</strong> <?php the_field('box_gw'); ?></li><?php endif; ?>
<?php if( get_field('cbm') ): ?><li><strong>Cbm:</strong> <?php the_field('cbm'); ?></li><?php endif; ?>
<?php if( get_field('amount_of_colli_on_a_pallet') ): ?><li><strong>Amount of colli on a pallet:</strong> <?php the_field('amount_of_colli_on_a_pallet'); ?></li><?php endif; ?>
<?php if( get_field('inner_box_type') ): ?><li><strong>Inner box type:</strong> <?php the_field('inner_box_type'); ?></li><?php endif; ?>
<?php the_field ('beskrivelse') ?>

<?php } ?>

2 Answers

you have a missing "<" on the "endif" for "get_field('size')".

Thank you very much for your help.

your welcome :)

Your probably going to need to give a little more of an explanation here in order to be helped. also try using the Markdown Cheetsheet to place your code inside the treehouse code formatter for the posts. will make it a little easier to read whats going on.

However, from you error code, it looks like you may have not closed an if statement somewhere. I would need this formatted a bit better to be able to tell forsure, and where that line of code might be.

I will try to use the Markdown Cheetsheet next time. I did not see the option at the time I posted.