Heyho,
ich hab ein kleines Problem, bei dem mir die PHP-Cracks unter euch sicher mit links helfen können. Und zwar möchte ich, dass meine Portfolio-Items nicht auf eine Single-Portfolio-Seite verlinken, sondern auf die Ursprungsbilder der Portfolio-Thumbnails - per fancybox!
Die Portfolio-Seite sieht momentan so aus:
PHP
<?php
/**
* @package WordPress
* @subpackage Adapt Theme
* Template Name: Portfolio
*/
?>
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<header id="page-heading2" class="clearfix">
<h1><?php the_title(); ?></h1>
<?php
//get portfolio categories
$cats = get_terms('portfolio_cats');
//show filter if categories exist
if($cats[0]) { ?>
<!-- Portfolio Filter -->
<ul id="portfolio-cats" class="filter clearfix">
<li class="sort"><?php _e('Sort Items',''); ?>:</li>
<li><a href="#all" rel="all" class="active"><span><?php _e('All', ''); ?></span></a></li>
<?php
foreach ($cats as $cat ) : ?>
<li><a href="#<?php echo $cat->slug; ?>" rel="<?php echo $cat->slug; ?>"><span><?php echo $cat->name; ?></span></a></li>
<?php endforeach; ?>
</ul>
<?php } ?>
</header>
<!-- /page-heading -->
<div class="post full-width clearfix">
<div id="portfolio-wrap" class="clearfix">
<ul class="portfolio-content">
<?php
//get post type ==> portfolio
query_posts(array(
'post_type'=>'portfolio',
'posts_per_page' => -1,
'paged'=>$paged
));
?>
<?php
$count=0;
while (have_posts()) : the_post();
$count++;
//get portfolio thumbnail
$thumbail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'grid-thumb');
//get terms
$terms = get_the_terms( get_the_ID(), 'portfolio_cats' );
$terms_list = get_the_term_list( get_the_ID(), 'portfolio_cats' );
?>
<?php if ( has_post_thumbnail() ) { ?>
<li data-id="id-<?php echo $count; ?>" data-type="<?php if($terms) { foreach ($terms as $term) { echo $term->slug .' '; } } else { echo 'none'; } ?>" class="portfolio-item">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<img src="<?php echo $thumbail[0]; ?>" height="<?php echo $thumbail[2]; ?>" width="<?php echo $thumbail[1]; ?>" alt="<?php echo the_title(); ?>" />
<div class="portfolio-overlay"><h3><?php echo the_title(); ?></h3></div><!-- portfolio-overlay -->
</a>
</li>
<?php } ?>
<?php endwhile; ?>
</ul>
<!-- /portfolio-content -->
</div>
<!-- /portfolio-wrap -->
<?php wp_reset_query(); ?>
</div>
<!-- /post full-width -->
<?php endwhile; ?>
<?php endif; ?>
<?php get_footer(); ?>
Alles anzeigen
Ich meine, das hier
und das hier
PHP
<a class="fancybox" href="<?php echo $full_img[0]; ?>" title="<?php echo apply_filters('the_title', $attachment->post_title); ?>" >
muss noch rein. Aber irgendwie führt das bislang zu nichts...Weiß jemand Rat?
Danke schon mal im Voraus
pabesco