<?php
/*
Template Name: Page Sitemap
*/
?>
<?php get_header(); ?>
<div id="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="page-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2><?php the_title(); ?></h2>
<div class="entry">
<?php the_post_thumbnail('medium', array('class' => 'alignleft')); ?>
<?php the_content(); ?>
<div class="clear"></div>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
<h2><?php _e('Latest Posts', ZEE_LANG); ?></h2><br/>
<ul>
<?php query_posts('post_type="post"&post_status="publish"&showposts=9'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
</ul>
<h2><?php _e('Pages', ZEE_LANG); ?></h2><br/>
<ul>
<?php wp_list_pages('title_li='); ?>
</ul>
<h2><?php _e('Categories', ZEE_LANG); ?></h2><br/>
<ul>
<?php wp_list_categories('title_li=&show_count=1'); ?>
</ul>
<h2><?php _e('Archives', ZEE_LANG); ?></h2><br/>
<ul>
<?php wp_get_archives('show_post_count=true'); ?>
</ul>
<h2><?php _e('Posts by Category', ZEE_LANG); ?></h2><br/>
<?php $categories = get_categories( $args ); ?>
<?php foreach($categories as $cat) : ?>
<strong><?php _e('Category', ZEE_LANG); ?>: <a href="<?php echo get_category_link( $cat->term_id ); ?>"><?php echo $cat->name; ?></a></strong>
<ul>
<?php query_posts('post_type="post"&post_status="publish"&cat='. $cat->term_id); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
</ul>
<?php endforeach; ?>
</div>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
->page-sitemap.php
<?php
// Theme Name
define('THEME_NAME', 'zeeCorporate');
define('THEME_INFO', 'http://themezee.com/zeeCorporate');
//Content Width
$content_width = 500;
//Load Styles and Scripts
add_action('wp_print_styles', 'themezee_stylesheets');
function themezee_stylesheets() {
wp_register_style('zee_stylesheet', get_stylesheet_directory_uri() . '/style.css');
wp_enqueue_style( 'zee_stylesheet');
}
add_action('init', 'themezee_register_scripts');
function themezee_register_scripts() {
wp_register_script('zee_jquery-ui-min', get_template_directory_uri() .'/includes/js/jquery-ui-1.7.2.custom.min.js', array('jquery'));
wp_register_script('zee_jquery-easing', get_template_directory_uri() .'/includes/js/jquery.easing.1.3.js', array('jquery', 'zee_jquery-ui-min'));
wp_register_script('zee_jquery-cycle', get_template_directory_uri() .'/includes/js/jquery.cycle.all.min.js', array('jquery', 'zee_jquery-easing'));
wp_register_script('zee_slidemenu', get_template_directory_uri() .'/includes/js/jquery.slidemenu.js', array('jquery', 'zee_jquery-cycle'));
}
add_action('wp_enqueue_scripts', 'themezee_enqueue_scripts');
function themezee_enqueue_scripts() {
wp_enqueue_script('jquery');
wp_enqueue_script('zee_jquery-ui-min');
wp_enqueue_script('zee_jquery-easing');
wp_enqueue_script('zee_jquery-cycle');
wp_enqueue_script('zee_slidemenu');
}
// init Localization
define('ZEE_LANG', 'zeeCorporate');
load_theme_textdomain(ZEE_LANG, TEMPLATEPATH . '/includes/lang');
// include Admin Files
locate_template('/includes/admin/theme-functions.php', true);
locate_template('/includes/admin/theme-settings.php', true);
locate_template('/includes/admin/theme-admin.php', true);
// Add Theme Functions
add_theme_support('post-thumbnails');
add_theme_support('automatic-feed-links');
add_custom_background();
add_editor_style();
// Add Custom Header
define('HEADER_TEXTCOLOR', '');
define('HEADER_IMAGE', get_stylesheet_directory_uri() . '/images/default_header.jpg');
define('HEADER_IMAGE_WIDTH', 900);
define('HEADER_IMAGE_HEIGHT', 140);
define('NO_HEADER_TEXT', true );
function header_style() {
?><style type="text/css">
#custom_header img {
margin-top: 20px;
width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
}
</style><?php
}
function admin_header_style() {
?><style type="text/css">
#headimg {
width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
}
</style><?php
}
add_custom_image_header('header_style', 'admin_header_style');
// Register Sidebars
if ( function_exists('register_sidebar') ) {
register_sidebar(array('name' => 'Sidebar Blog','id' => 'sidebar-blog'));
register_sidebar(array('name' => 'Sidebar Pages','id' => 'sidebar-pages'));
}
// Register Menus
if ( function_exists( 'register_nav_menu' ) ) {
register_nav_menu( 'main_navi', 'Main Navigation' );
}
function display_pages() {
echo '<ul>';
wp_list_categories('title_li=&depth=1&number=4');
echo '</ul>';
}
// include Plugin Files
locate_template('/includes/plugins/theme_socialmedia_widget.php', true);
locate_template('/includes/plugins/theme_ads_widget.php', true);
// Functions for correct html5 Validation
function html5_gallery($content)
{
return str_replace('[gallery', '[gallery itemtag="div" icontag="span" captiontag="p"', $content);
}
add_filter('the_content', 'html5_gallery');
add_filter('gallery_style', create_function('$a', 'return preg_replace("%<style type=\'text/css\'>(.*?)</style>%s", "", $a);'));
function html5_embed($return, $data, $url)
{
$search = '|></embed>|is';
$replace = ' />';
return preg_replace( $search, $replace, $return );
}
add_filter( 'oembed_dataparse', 'html5_embed', 10, 3);
function html5_elements($content)
{
$content = str_replace('<acronym', '<abbr', $content);
$content = str_replace('</acronym', '</abbr', $content);
$content = str_replace('<big', '<span class="big_tag"', $content);
$content = str_replace('</big', '</span', $content);
$content = str_replace('<tt', '<span class="tt_tag"', $content);
$content = str_replace('</tt', '</span', $content);
return $content;
}
add_filter('the_content', 'html5_elements');
add_filter('comment_text', 'html5_elements');
?>
Alles anzeigen
->functions.php
Bin Laie, muss ich hier was verändern?