-1

This is my code. When I want to load my localhost its happening something. The syntax problem is: Parse error: syntax error, unexpected '=' in

How to solve it?

<img src="<?php $slide-image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'slider-image' ); echo $slide-image[0]; ?>" alt="<?php the_title();?>" title="<?php the_ID(); ?>"/>
iainn
  • 16,826
  • 9
  • 33
  • 40
  • Ease up guys - that "duplicate" is just way too much info to tread thru. – Tarek Adam Apr 24 '18 at 18:45
  • 1
    @TarekAdam You don't have to read every single link there, however the question is well indexed and the accepted answer, even though it's 3-4 pages long, contains the general steps to debug syntax errors, which should help in most, if not all cases. The point of Stack Overflow is not to spoonfeed answers to people, but to help them and future visitors learn and improve their programming skills. If someone doesn't want to take the time and learn basic programming (in whatever language) this site is not for them. Just my $0.02. – Mike Apr 24 '18 at 19:13
  • 1
    @Mike Ya, I can appreciate that. BTW - if you ever get over to Tamarindo, look me up. – Tarek Adam Apr 24 '18 at 21:43
  • @TarekAdam Would be nice, but I'm stuck in San Jose! Thanks for the invite! – Mike Apr 25 '18 at 00:20

2 Answers2

0

You need a '>' in echo $slide-image[0];

should be echo $slide->image[0]

Yassine
  • 76
  • 1
  • 8
0

$side-image is side minus image. Not a valid variable name.

Tarek Adam
  • 3,387
  • 3
  • 27
  • 52