Title: Rendering PHP and HTML with condition, problem with array on image URL
Last modified: August 20, 2016

---

# Rendering PHP and HTML with condition, problem with array on image URL

 *  [Agnes](https://wordpress.org/support/users/agneslesagegmailcom/)
 * (@agneslesagegmailcom)
 * [14 years ago](https://wordpress.org/support/topic/rendering-php-and-html-with-condition-problem-with-array-on-image-url/)
 * I have this custom type that displays thumbnails and a “zoom” link opens a thickbox.
   
   It can be seen on here (login / pwd demo/demo) [http://www.morija.co.ls/morija/museum/collections/art/](http://www.morija.co.ls/morija/museum/collections/art/)
 * I am trying to insert a random selection of these objects, and it works well 
   uising this code:
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   The maximum number of lines of code that you can post in these forums is **ten
   lines**. Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * The problem is: the zoomlink cant find the image anymore.
    It should return an
   image URLK with `$image_url;` In the 1st case, `echo $image_url;` returns `$image_url;`
   In the secojnd case, it returns ‘array’. I dont understand why writing in my 
   condition affects this.
 * And I am not a PHP expert!
    Any idea? Thanks, Agnes

Viewing 1 replies (of 1 total)

 *  Thread Starter [Agnes](https://wordpress.org/support/users/agneslesagegmailcom/)
 * (@agneslesagegmailcom)
 * [14 years ago](https://wordpress.org/support/topic/rendering-php-and-html-with-condition-problem-with-array-on-image-url/#post-2783376)
 * OK, I foudn out I can do with a cionditional include:
 *  `<?php if ( is_page( ‘collections’ )) {
    include(“inc-random-objects.php”); }?
   >`
 * And then my original HTML code works!

Viewing 1 replies (of 1 total)

The topic ‘Rendering PHP and HTML with condition, problem with array on image URL’
is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Agnes](https://wordpress.org/support/users/agneslesagegmailcom/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/rendering-php-and-html-with-condition-problem-with-array-on-image-url/#post-2783376)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
