PHP and HTML
-
Dear Team,
I would like to add a conditional statement in PHP in my wordpress page in order to show the following HTML on 2014:<div class=”ngg-albumoverview”>
<!– List of galleries –>
<div class=”ngg-album”>
<div class=”ngg-albumtitle”>2014</div>
<div class=”ngg-albumcontent”>
<div class=”ngg-thumbnail”><img class=”Thumb” alt=”selected” src=”***” /></div>
<div class=”ngg-description”>***</div>
</div>
</div>I downloaded the plugin then I did the following code but it didn’t work:
[php]
$year = 2014;
$today = date(“Ymd”);
$today_year = date (“Y”, mktime(0,0,0,substr($startw,4,2),substr($startw,6,2),substr($startw,0,4)));
if ($today_year == $year) {
[/php]
<div class=”ngg-albumoverview”>
<!– List of galleries –>
<div class=”ngg-album”>
<div class=”ngg-albumtitle”>2014</div>
<div class=”ngg-albumcontent”>
<div class=”ngg-thumbnail”><img class=”Thumb” alt=”selected” src=”***” /></div>
<div class=”ngg-description”>***</div>
</div>
</div>
[php]
}
[/php]I got:
Parse error: syntax error, unexpected $end in /membri/depaict/micki/wp-content/plugins/allow-php-in-posts-and-pages/allowphp.php(373) : eval()’d code on line 6
and
Parse error: syntax error, unexpected ‘}’ in /membri/depaict/micki/wp-content/plugins/allow-php-in-posts-and-pages/allowphp.php(373) : eval()’d code on line 2Thanks in advance
Regards,
Stefaniahttps://www.ads-software.com/extend/plugins/allow-php-in-posts-and-pages/
- The topic ‘PHP and HTML’ is closed to new replies.