Nested echo php code
-
Hello, I have a WP page with some links to click. Every time a link is clicked some images are displayed , each link clicked show different images. To do that I am using PHP to GET the link clicked. With plugin Insert PHP code snippet I manage the event after the link is clicked with the following:
if(isset($_GET['link'])){ $link=$_GET['link']; if ($link == '1'){ $url1= "https://localhost\Images\Site_Library\Standard\\" . $img1 . ".png"; } if ($link == '2'){ $url2= ".\WpSito2\Images\Site_library_page\Standard\\" . $img2 . ".png"; } }
I am in trouble when I try to echo the image related to link1 or link2 with the following code and short-code:
<?php echo $url1 ?> Shortcode [xyz-ips snippet="echo-url1"] <div class="divi_1_psl" ><img class="img_psl" src="[xyz-ips snippet="echo-url1"]"></div>
Surfing internet looking for a solution I didn’t solve.It’s seems that WP does not support netest code.
Do you anyone have any idea in order to run nested code or to have an alternative solution regarding my issue.
Thanks in advance
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Nested echo php code’ is closed to new replies.