function body_class() { $classes = array(); // Get the URL slug $parts = explode('/', Uri::current()); $classes[] = count($parts) ? trim(current($parts)) : 'index'; // Is it a posts page? if (is_postspage()) { $classes[] = 'posts'; } // Is it the homepage? if (is_homepage()) { $classes[] = 'home'; } return implode(' ', array_unique($classes)); }
function body_class() { $classes = array(); // Is it a posts page? if (is_postspage()) { $classes[] = 'posts'; } // Is it the homepage? if (is_homepage()) { $classes[] = 'home'; } // Is it a single post? if (is_article()) { $classes[] = 'article'; } // Is it a custom page? if (is_page()) { $classes[] = 'page'; } return implode(' ', array_unique($classes)); }
<?php defined('IN_CMS') or die('No direct access allowed.'); $home = is_postspage(); $url = isset($url) && !$home ? $url : article_url(); $title = isset($title) && !$home ? $title : article_title(); $time = isset($time) && !$home ? $time : article_time(); $excerpt = isset($excerpt) && !$home ? $excerpt : trim(article_description()); $excerpt = $excerpt == "" ? false : $excerpt; $content = isset($content) && !$home ? $content : article_html(); $image = isset($image) && !$home ? $image : article_custom_field('img', false); $isArticle = isset($isArticle) && $isArticle; $uurl = urlencode(full_url()); $utitle = urlencode($title); $tags = array("theme_url" => theme_url()); foreach ($tags as $s => $r) { $content = str_replace("{" . $s . "}", $r, $content); } ?> <li class="<?php if (isset($first) && $first) { echo "showContent"; } if (!$time) { echo " noFooter"; } echo is_single() ? " single" : " multiple"; ?> "> <header tabindex="-1"> <!--<a href="<?php
function is_single() { return !is_postspage(); }