hallo miteinander!
ich habe auf themeforest folgendes theme erworben:
http://themeforest.net/item/cross-app…s-theme/1091979
bisher komme ich damit super zurecht nur ein problem habe ich und bekomme ich nicht in den griff.
ich hätte gern für jede portfolio-category ein extra seiten template.
momentan gibt es eine portfolio.php , darin sind verschiedene loops eingearbeitet, welche im oberen bereich die vorhandenen kategorien als menü auflisten. mit auswahl einer kategorie wird diese dann gefiltert und angezeigt.
das ist für meinen zweck leider etwas unvorteilhaft. :???:
darum möchte ich gern für jede category ein extra template, welches ich dann einer wp-seite zuweisen kann.
könnte ihr mir helfen?:neutral::neutral:
anbei mal die portfolio.php und die loop-portfolio-1.php
portfolio.php
<?php
/*
* ----------------------------------------------------------------------------------------------------
* Template Name: Portfolio
* @PACKAGE BY HAWKTHEME
* ----------------------------------------------------------------------------------------------------
*/
get_header();
$list_style = theme_get_option('cat','list_style');
switch($list_style)
{
case 1: $loop = '1'; break;
case 2: $loop = '2'; break;
case 3: $loop = '2'; break;
case 4: $loop = '2'; break;
case 5: $loop = '3'; break;
case 6: $loop = '3'; break;
case 7: $loop = '3'; break;
}
?>
<!--Begin Container-->
<div id="container" class="clearfix fullwidth">
<?php theme_page_banner(); ?>
<div id="container-wrap" class="col-width clearfix">
<!--Begin Content-->
<article id="content">
<?php
if (have_posts()) : the_post();
$content = get_the_content();
?>
<?php if($content) : ?>
<div class="post-content">
<?php the_content(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<!--End page content-->
<?php
//Adhere To Paging Rules
if ( get_query_var('paged') ) {
$paged = get_query_var('paged');
} elseif ( get_query_var('page') ) {
// applies when this page template is used as a static homepage in WP3+
$paged = get_query_var('page');
} else {
$paged = 1;
}
$showposts = theme_get_option('portfolio','list_showposts');
$query_args = array(
'post_type' => 'portfolio',
'posts_per_page' => $showposts,
'paged' => $paged
);
//End Query String
query_posts($query_args);
?>
<?php if (have_posts()): ?>
<?php
get_template_part('loops/loop', 'portfolio-'.$loop.'');
theme_pagination();
?>
<?php else : ?>
<!--Begin No Post-->
<div class="no-post">
<h2><?php esc_html_e('Not Found', 'HK'); ?></h2>
<p><?php esc_html_e("Sorry, but you are looking for something that isn't here.", 'HK'); ?></p>
</div>
<!--End No Post-->
<?php endif; ?>
</article>
<!--End Content-->
</div>
</div>
<!--End Container-->
<?php get_footer(); ?>
Alles anzeigen
loop-portfolio-1.php
<?php
/*
* ----------------------------------------------------------------------------------------------------
* Portfolio Loop 1- This is a pagination list with one column.
* @PACKAGE BY HAWKTHEME
* ----------------------------------------------------------------------------------------------------
*/
$portfolio_page_id = theme_get_option('portfolio','page_for_portfolio');
$list_lightbox = theme_get_option('portfolio','list_lightbox');
$read_more = theme_get_option('portfolio','read_more');
?>
<?php
$menu_args = array(
'taxonomy' => 'portfolio-types',
'orderby' => 'name',
'show_count' => 0, // 1 for yes, 0 for no
'hierarchical' => 1, // 1 for yes, 0 for no
'hide_empty' => 0, // 1 for yes, 0 for no
'title_li' => '',
'depth' => 1
);
?>
<nav class="portfolio-menu">
<ul class="clearfix">
<?php
if(get_the_ID() == $portfolio_page_id ) {
$current_class = ' class="current-cat"';
}else{
$current_class = '';
}
if($portfolio_page_id) {
echo '<li'.$current_class.'><a href="'.get_page_link($portfolio_page_id).'">';
esc_html_e('All','HK');
echo '</a></li>';
}
wp_list_categories( $menu_args );
?>
</ul>
</nav>
<ul class="portfolio-lists">
<?php
while (have_posts()) : the_post();
$desc = get_the_excerpt();
if($list_lightbox == true)
{
$link = theme_large_image_uri();
$rel = 'data-id="fancybox"';
}else{
$link = get_permalink();
$rel = 'rel="bookmark"';
}
$feature_image = get_meta_option('feature_image');
?>
<!--Begin Item-->
<li class="post clearfix">
<div class="post-entry clearfix"<?php if ( !has_post_thumbnail() ) { echo ' style="width: 100%;"'; } ?>>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<p class="post-excerpt"><?php echo do_shortcode( shortcode_unautop( $desc ) ); ?></p>
<?php if($read_more) :?><p class="post-more"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php echo $read_more; ?></a></p><?php endif; ?>
</div>
<?php if($feature_image) : ?>
<div class="post-thumb">
<a href="<?php echo $link; ?>" title="<?php the_title_attribute(); ?>" class="image-link" <?php echo $rel; ?>>
<img width="650" height="260" src="<?php echo $feature_image; ?>" class="wp-post-image" alt="<?php the_title_attribute(); ?>" title="<?php the_title_attribute(); ?>" />
</a>
</div>
<?php elseif ( has_post_thumbnail() ) : ?>
<div class="post-thumb">
<a href="<?php echo $link; ?>" title="<?php the_title_attribute(); ?>" class="image-link" <?php echo $rel; ?>>
<?php the_post_thumbnail('650-260'); ?>
</a>
</div>
<?php endif; ?>
</li>
<!--End Item-->
<?php endwhile; ?>
</ul>
Alles anzeigen
ich wäre euch wirklich sehr sehr dankbar :-)