Come aggiungere una funzione 'Clicca per Ingrandire l'Immagine' con apertura dell'immagine ingrandita in un popup?
Ho diverse immagini di form UI e attività che sono piuttosto grandi. Vorrei visualizzare un'immagine più piccola come 'miniatura' e dare all'utente l'opzione di 'Clicca per Ingrandire', per poi mostrare l'immagine a dimensione intera in un pop-up, in una finestra separata o in una nuova scheda. I pop-up non sono molto apprezzati, ma questa è una decisione che devo ancora prendere.
Come posso procedere? Dove dovrei inserire il JavaScript che carica l'immagine a dimensione intera e apre una nuova finestra?
Dovresti utilizzare un lightbox per questo. Prova questo. Funziona bene
http://lokeshdhakar.com/projects/lightbox2/
Ci sono istruzioni su come usarlo e documentazione su come farlo funzionare. Il download conterrà anche degli esempi e potrai semplicemente copiare e incollare il codice.

<?php get_header(); ?>
<?php get_sidebar();?>
<div id="content">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class($class); ?>>
<header class="entry-header">
<?php if(has_post_thumbnail()):?>
<?php the_post_thumbnail('full', array('alt' => esc_attr(get_the_title()), 'title' => esc_attr(get_the_title()))); ?>
<?php endif; ?>
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Link permanente a %s', 'ifoti' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
</h1>
<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
<?php ifoti_posted_on(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Mostra solo l'estratto per la ricerca ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continua a leggere <span class="meta-nav">→</span>', 'ifoti' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pagine:', 'ifoti' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<?php $show_sep = false; ?>
<?php if ( 'post' == get_post_type() ) : // Nascondi categorie e tag per le pagine nella ricerca ?>
<?php
$categories_list = get_the_category_list( __( ', ', 'ifoti' ) );
if ( $categories_list ):
?>
<span class="cat-links">
<?php printf( __( '<span class="%1$s">Pubblicato in</span> %2$s', 'ifoti' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
$show_sep = true; ?>
</span>
<?php endif; // Fine if categorie ?>
<?php
$tags_list = get_the_tag_list( '', __( ', ', 'ifoti' ) );
if ( $tags_list ):
if ( $show_sep ) : ?>
<span class="sep"> | </span>
<?php endif; // Fine if $show_sep ?>
<span class="tag-links">
<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'ifoti' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
$show_sep = true; ?>
</span>
<?php endif; // Fine if $tags_list ?>
<?php endif; // Fine if 'post' == get_post_type() ?>
<?php if ( comments_open() ) : ?>
<?php if ( $show_sep ) : ?>
<span class="sep"> | </span>
<?php endif; // Fine if $show_sep ?>
<span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Lascia un commento', 'ifoti' ) . '</span>', __( '<b>1</b> Commento', 'ifoti' ), __( '<b>%</b> Commenti', 'ifoti' ) ); ?></span>
<?php endif; // Fine if comments_open() ?>
<span class="sep"> | </span>
<?php edit_post_link( __( 'Modifica', 'ifoti' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- #entry-meta -->
<div class="socialbtn">
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style"addthis:url="<?php the_permalink() ?>">
<a class="addthis_button_email">Email</a>
<a class="addthis_button_print">Stampa</a>
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4f97067f47ad8fdb"></script>
<!-- AddThis Button END -->
</div>
<div>
<?php comments_template();?>
</div>
</article><!-- #post-<?php the_ID(); ?> -->
<?php endwhile; ?>
<?php else : ?>
Nessun risultato;
<?php endif; ?>
</div>
<?php get_footer(); ?>
Elemento della lista

Le risposte dovrebbero essere più di un semplice frammento di codice. Per favore modifica e spiega perché questa soluzione potrebbe funzionare.
