• artistbendavis

    (@artistbendavis)


    Hi this has been driving me crazy. I’ve created an attachment.php that displays the image i want shown and a gallery underneath of it. The last thing i need to do is figure out how to change which gallery is being displayed depending on which link I’ve clicked. I’ve only been able to succeed in making the first link on the drawing page display the drawing gallery. Here is my code right now which is the closest I’ve gotten:

    <?php if ($_SERVER[‘QUERY_STRING’]== “attachment_id=144”)
    {echo do_shortcode(‘[gallery ids="144,143,133,126,127,125,132,130,128"]‘);
    }
    else{echo do_shortcode(‘[gallery ids="243,247,250,249,245,241,246,248,244"]‘);;}?>

    I’ve tried to make the query string specify all of the attachment pages I need but i haven’t been able to make that work either(I very likely may be just coding it wrong I’m still a noob) I’ve tried something like ($_SERVER[‘QUERY_STRING’]== “attachment_id=144”, “attachment_id=143”) and ($_SERVER[‘QUERY_STRING’]== “attachment_id=144” || “attachment_id=143”) and etc.

    Here is a link to my website if this helps:
    http://www.artistbendavis.com/
    It’s basically done other than this so I’m going insane trying to figure this out.

    In Short:
    When I click a drawing link, I want to be brought to the attachment page with the drawing gallery being displayed underneath of it.

    When I click a colored image link, I want to be brought to the attachment page with the regular colored gallery being displayed underneath of it.

    Some help with this would be amazing I’ve been at this for hours. Thanks!!

  • The topic ‘Make attachment page display specific gallery for specific links’ is closed to new replies.