Mika
Mika

Reputation: 23

Pagination code on Concrete5 (Foundation5 theme)

i'm trying to fix my pagination on my Concrete5 site. I got this code on my *.php file:

<?php   if ($paginate && $num > 0 && is_object($pl)) { ?>
<div class="ff-grid-4-pagination-wrapper small-12 columns pagination     centered">
<ul class="ff-grid-4-pagination pagination">
<li class="arrow"></li>
<?php   echo $paginator->getPages('li') ?>
<?php  if ($showRss): ?><li><a class="fa fa-rss" href="<?php   echo $rssUrl ?>" target="_blank"></a></li><?php  endif; ?>
<li class="arrow"></li>
</ul><!-- END .ff-grid-4-pagination -->
</div><!-- END .ff-grid-4-pagination-wrapper -->
<?php endif; ?>

Somehow i got error on Dreamweaver saying that my last line is wrong? What is the right way to end my code?

Sincerely,

Mika

Upvotes: 1

Views: 157

Answers (1)

DonCallisto
DonCallisto

Reputation: 29912

<?php if ($paginate && $num > 0 && is_object($pl)) { ?>

should be

<?php if ($paginate && $num > 0 && is_object($pl)): ?>

as you're terminating your script with

<?php endif; ?> instead of <?php } ?>


Alternatively you could change your last line from <?php endif; ?> to <?php } ?> for same reasons described above.

Moreover I suggest you to keep your syntax consistent between files, so if you use if (...): you should use that kind of syntax in every file.

To conclude: don't stop yourself at editor or ide error: if the hint provided by IDE isn't a good one, try to run your php code (with error reporting on) and try to understand what's the error

Upvotes: 1

Related Questions