Go to URL which is in the attachments’s description
-
Dear All,
This is my webpage: LINK.
Could you please help me? I have a Portfolio page which contain the project’s attachment thumbnails.
You can see here!What I would like to: When I click to the thumbnails, go to URL (target: new window) which is in the attachments’s description. So, NOT to the project page…
Here is the code for this template which I have:
<?php get_header(); ?> <!-- start content wrapper --> <div class="container"> <div class="page-title"> <h1><?php the_title(); ?></h1> </div> <div class="divider mbottom10 clear"></div> <!-- start portfolio filter --> <div class="filter" id="filter"> <ul> <li> <a title="Link title" class="active" href="#" data-category="all">All</a> </li> <?php $categories = get_categories('type=portfolio&taxonomy=portfolio-type'); foreach ($categories as $category) { ?> <li class="<?php echo $category->slug ?>" > <a href="" data-category="<?php echo $category->slug ?>"><?php echo $category->name ?></a> </li> <?php } ?> </ul> </div> <!-- end portfolio filter --> <div class="divider clear"></div> <!-- start portfolio items --> <div class="portfolio-wrapper"> <ul class="isotope-container"> <?php $args = array( 'post_type' => 'portfolio', 'posts_per_page' => -1 ); $query = new WP_Query( $args ); while ( $query->have_posts() ) : $query->the_post(); ?> <?php $terms = get_the_terms( $post->ID, 'portfolio-type' ); $term_list = ''; $image_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'featured-image-thumb'); $featured_image = quick_resize('248','165', $image_url[0]); if( is_array($terms) ) { foreach( $terms as $term ) { $term_list .= $term->slug; $term_list .= ' '; } } ?> <?php $mediaType = get_post_meta($post->ID, '_project_type_value', true); switch( $mediaType ) { case "Image": case "Slideshow": ?> <!-- start work --> <li id="<?php echo the_ID()?>" <?php post_class("$term_list isotope-item all"); ?> > <?php if(has_post_thumbnail()): ?> <div class="portfolio-thumb hasheight"> <a class="linkto" href="<?php the_permalink(); ?>" title="<?php printf(__('Permanent link to %s', 'photolio'), get_the_title()); ?>"> <img src="<?php echo $featured_image; ?>" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" /> <span class="over-more"><?php _e('View project','photolio') ?></span> <span class="over-more-title"><?php the_title(); ?></span> </a> </div> <?php endif; ?> </li> <?php break; } endwhile; ?> <!-- end work --> </ul> </div> <!-- end latest work --> </div> <!-- end content wrapper --> <?php get_footer(); ?>
I would really appreciate any help! 🙂
Thank you!
Regards,
toserandras
Viewing 1 replies (of 1 total)
-
Sorry, the Portfolio page named like “Linkek”.
Viewing 1 replies (of 1 total)
- The topic ‘Go to URL which is in the attachments’s description’ is closed to new replies.