Skip to content

Instantly share code, notes, and snippets.

@soska
Created December 14, 2009 19:12
Show Gist options
  • Save soska/256319 to your computer and use it in GitHub Desktop.
Save soska/256319 to your computer and use it in GitHub Desktop.
<?php
echo csml::tag('div#header');
echo csml::entag('This is the header','h1#site-name.page-title');
echo csml::tag('/div');
/*
Output:
<div id="header">
<h1 id="site-name" class="page-title">This is the header</h1>
</div>
*/
?>
<?php
include("csml.php");
t('div#container');
t('div#content');
t('div#header');
en('This is the header',array('h1.page-title','a.link[href="http://duperrific.com" rel="friend"]'),'',INLINE);
t('/div');
t('ul#main.navigation');
en('Home',array('li','a[href="/home"]'));
en('About',array('li','a[href="/about"]'));
en('Login',array('li','a[href="/login"]'));
en('Signup',array('li','a[href="/signup"]'));
t('/');
// selectors can also be passed as an array in the second argument
$selectors = array(
'ul.navigation',
'li',
'a.button[href="http://google.com"]',
);
en("Go to Google",$selectors);
// output: <ul class="navigation><li><a href="http://google.com"" class="button">Go to Google</a></li></ul>
t('/div#content');
t('/div#container');
?>
<?php if ( is_404() || is_category() || is_day() || is_month() ||
is_year() || is_search() || is_paged() ) {
?> <li>
<?php /* If this is a 404 page */ if (is_404()) { ?>
<?php /* If this is a category archive */ } elseif (is_category()) { ?>
<p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>
<?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
for the day <?php the_time('l, F jS, Y'); ?>.</p>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
for <?php the_time('F, Y'); ?>.</p>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
for the year <?php the_time('Y'); ?>.</p>
<?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
<p>You have searched the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>
<?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<p>You are currently browsing the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives.</p>
<?php } ?>
</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment