Instantly share code, notes, and snippets.
joeworkman
/ total-cms-blog-category-menu.php
Last active
November 16, 2018 23:27
This will create menu items for every category in a Total CMS blog. You can place this snippet in any Foundation menu stack that supports custom HTML menus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li class='has-dropdown'><a href='#'>Categories</a><ul class='dropdown'> | |
<?php | |
$cmsid = "blog"; | |
$attribute = "category"; // tag, category, author | |
$href = "/blog/?category="; // URL to blog list with category filter | |
//----------------------------------------------- | |
// Do not modify below this line | |
//----------------------------------------------- | |
if ($publish) { |
joeworkman
/ total-cms-blog-menu.php
Last active
February 5, 2019 20:52
This will create menu items for all blog posts inside Total CMS. You can place this snippet inside of any Foundation menu stack that supports custom HTML menus.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li class='has-dropdown'><a href='#'>Blog</a><ul class='dropdown'> | |
<?php | |
$cmsid = "blog"; | |
//----------------------------------------------- | |
// Do not modify below this line | |
//----------------------------------------------- | |
if ($publish) { | |
$totalblog = new \TotalCMS\Component\Blog($cmsid); | |
$posts = $totalblog->filter_posts(); |