• Agnes

    (@agneslesagegmailcom)


    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)
    https://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. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    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

    (@agneslesagegmailcom)

    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.