Title: PHP Help Please..
Last modified: August 19, 2016

---

# PHP Help Please..

 *  [rellison](https://wordpress.org/support/users/rellison/)
 * (@rellison)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/php-help-please-1/)
 * I have a section of PHP code that looks like this
 *     ```
       <?php $header = $suf_header_fg_image_type == 'image' ? "<img src='$suf_header_fg_image' alt='".get_bloginfo('name')."'/>" : get_bloginfo('name');
       	if ($suf_sub_header_vertical_alignment == "above") {	?>
          		<div class="description"><?php echo bloginfo('description');?></div>
          		<div class="blogtitle"><a href="<?php echo get_option('home');?>"><?php echo $header;?></a></div>
       ```
   
 * I need to add an image into the header that is part of a javascript that is loaded
   previous to this. I want to do something like this..
 *     ```
       <?php $header = "<img id='Rotating1' border='0' '/>";
        $header = $header . $suf_header_fg_image_type == 'image' ? "<img src='$suf_header_fg_image' alt='".get_bloginfo('name')."'/>" : get_bloginfo('name');
       ```
   
 * But I keep getting a syntax error in the newly added line. I have sat here for
   3 hours now trying to figure this out. Could someone show me the correct format
   I am supposed to use to do this??
 * Thanks
 * Rick

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

 *  [wprelief](https://wordpress.org/support/users/wprelief/)
 * (@wprelief)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/php-help-please-1/#post-1573788)
 * Try this:
 *     ```
       <?php $header = "<img id='Rotating1' border='0' />";
        $header = $header . ($suf_header_fg_image_type == 'image' ? "<img src='$suf_header_fg_image' alt='".get_bloginfo('name')."'/>" : get_bloginfo('name'));
       ```
   
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/php-help-please-1/#post-1573819)
 * Or.
 *     ```
       <?php
       $header = '<img id="Rotating1" border="0" />';
       // Concatenate
       $header .=
       // Ternary conditional check
       ( 'image' == $suf_header_fg_image_type )
       // Assignment if condition true
       ? '<img src="' . $suf_header_fg_image . '" alt="' . get_bloginfo('name') . '" />'
       // Else assignment
       : get_bloginfo('name');
       ```
   

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

The topic ‘PHP Help Please..’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/php-help-please-1/#post-1573819)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
