Snippet · Mecha CMS

Code snippet collection for developers.

Disable Comments on Static Pages

Author: Taufik Nurrohman · 389 Views

Tweet

Disable comments on pages that are relative to the root URL.

Disable comments on pages that are relative to the root URL like http://example.com/about. Requires comment extension.

<?php if (strpos($url->path, '/') !== false): ?>
<?php Shield::get('comments'); ?>
<?php endif; ?>

0 Comments

No comments yet.