<?php if (isset($wp_query->queried_object_id)) { $rating = get_post_meta($wp_query >queried_object_id, ‘rating’, true); } ?>
<title><?php bloginfo(‘name’); ?><?php if (isset($rating)) { echo ‘ – Rating=’ . $rating; } ?></title>
<?php
/**
Template Page for the gallery overview
Follow variables are useable :
$gallery : Contain all about the gallery
$images : Contain all images, path, title
$pagination : Contain the pagination content
You can check the content when you insert the tag <?php var_dump($variable) ?>
If you would like to show the timestamp of the image ,you can use <?php echo $exif[’created_timestamp’] ?>
**/
?>
<?php if (!defined (’ABSPATH’)) die (’No direct access allowed’); ?><?php if (!empty ($gallery)) : ?>
<div class = “slideshow”>
<?php foreach ( $images as $image ) : ?>
<?php if ( !$image->hidden ) { ?>
<img title=”<?php echo $image->alttext ?>” alt=”<?php echo $image->alttext ?>” src=”<?php echo $image->imageURL ?>” width = “<?php echo $image->meta_data[’width’]?>” height = “<?php echo $image->meta_data[’height’]?>” />
<?php } ?>
<?php if ( $image->hidden ) continue; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php query_posts( array(’cat’ => $cat,’meta_key’ => side, ‘meta_value’ =>left ));// Loop Anzeige linke Seite ?>
<?php
if (in_category(’16′)) {include (TEMPLATEPATH . ‘/single-16.php’);
}
else { include (TEMPLATEPATH . ‘/single-01.php’);
}
?>
if ( !function_exists(’fb_filter_child_cats’) ) {
function fb_filter_child_cats( $cats ) {
global $wp_query, $wpdb;
if ( is_category() ) {
// get children ID’s
if ( $excludes = get_categories( “child_of=” . $wp_query->get(’cat’) ) ) {
// set array with ID’s
foreach ( $excludes as $key => $value ) {
$exclude[] = $value->cat_ID;
}
}
// remove child cats
if ( isset($exclude) && is_array($exclude) ) {
$cats .= ” AND ” . $wpdb->prefix . “term_taxonomy.term_id NOT IN (” . implode(”,”, $exclude) . “) “;
}
}
return $cats;
}
if ( !is_admin() ) {
add_filter( ‘posts_where’, ‘fb_filter_child_cats’ );
}
}
<?php
if($post->page_type != 'post') {
if(wp_list_pages("child_of=".$post->ID."&echo=0")) { ?>
<ul id="submenu">
<?php wp_list_pages("title_li=&child_of=".$post->ID."&sort_column=menu_order&depth=1");?>
</ul>
<?php } elseif(wp_list_pages("child_of=".$post->post_parent."&echo=0") && $post->post_parent != 0) { ?>
<ul id="submenu">
<?php wp_list_pages("title_li=&child_of=".$post->post_parent."&sort_column=menu_order&depth=1"); ?>
</ul>
<?php }
}
?>
<?php //zurueck
if ($posts[0]->post_parent != 0) // Wenn es "Unterseite" mit "Mutterseite" ist
{
?>
<ul>
<?php
$mutterseite = get_postdata($posts[0]->post_parent);
?>
<li class="page_item"><a href="<?php echo get_permalink($mutterseite[ID]); ?>" title="Eine Ebene zurueck">Zurueck</a></li>
</ul>
<?php
}
?>
<?php
if (is_page()) // Wenn’s eine Seite ist
{
if ($posts[0]->post_parent != 0) // Wenn es “Unterseite” mit “Mutterseite” ist
{
?>
<ul class=”navilist”>
<?php
$mutterseite = get_postdata($posts[0]->post_parent);
?>
<li class=”page_item”><a href=”<?php echo get_permalink($mutterseite[ID]); ?>” title=”<?php echo $mutterseite[Title];?>”><?php echo $mutterseite[Title]; ?></a></li>
<?php wp_list_pages(’title_li=&sort_column=menu_order&child_of=’.$posts[0]->post_parent); ?>
</ul>
<?php
}
else // Wenn Seite eine “Oberseite” ohne “Mutterseite” ist
{
?>
<ul class=”navilist”>
<li class=”page_item current_page_item”><a href=”<?php the_permalink()?>” title=”<?php the_title();?>”><?php the_title(); ?></a></li>
<?php wp_list_pages(’title_li=&sort_column=menu_order&child_of=’.$posts[0]->ID); ?>
</ul>
<?php
}
} // else für Kategorien, Archive und Single
?>
gefunden bei eric –> Multi-(Sub)Domain-WordPress
Faulheit sollte unterstütz werden. Diese Tipp … *grins*. Funz auch mit WP 2.2.
kleine Erweiterung …
sollen unterschiedliche Domainnamen z.B. mit und ohne Trennstrich und, oder unterschiedlichen .tld und mit oder ohne www. auf den identischen Blog zeigen so erweitere man den Eintrag in der wp_config.php damit.
$table_prefix = str_replace( array( “.” ,”w”,”com”,”de”,”biz”,”-” ), “”, $_SERVER[”HTTP_HOST”] ).”_”; // Only numbers, letters, and underscores please!
Somit unterscheidet sich die einzelnen Instanzen nur noch an den Subdomain’s. Damit hat man ein Construkt ähnlich der Section von Textpattern.
gefunden bei
http://www.spitzohr.de/kategorie/computer_und_internet/wordpress/
und hier ist der Code … ich hoffe er verzeiht mir ….
<?php
if (is_page()) {
$top_post = $post;
while ($top_post->post_parent <> 0) {
$top_post = get_post($top_post->post_parent);
}
if (wp_list_pages(’child_of=’ . $top_post->ID . ‘&title_li=&echo=0′ ) <> "") {
?>
<li><h2><?php echo $top_post->post_title; ?></h2>
<ul>
<?php
wp_list_pages(’sort_column=menu_order&child_of=’ . $top_post->ID . ‘&title_li=’ ); ?>
</ul>
</li>
<?php
} /* Gibt es Pages? */
} /* Ist es eine Page? */
?>
Um die Anzeige der Category in Main- und Subcategory zu unterteilen, mag folgendes Codefragment hilfreich sein.
<?php
/*
im header einfuegen
*/
wp_list_cats(’sort_column=ID&optioncount=0&hierarchical=1&children=0′); //alle elternkategorien
?>
<h2>Subkategorie</h2>
<ul>
<?php
/*
in der sidebar einfuegen
*/
$cat_object = $wp_query->get_queried_object();
$parentcat = ($cat_object->category_parent) ? $cat_object->category_parent : $cat;
echo get_cat_name($parentcat); // kategoriename der elternkategorie
wp_list_cats("child_of=$parentcat"); // subkategorien
?>
</ul>