Single.php id calling
-
Hi guys,
So I created a gallery(custom) and well when you click on one of the images(that would be archive.php), which then redirects you to single.php(with information of the picture and itself).
Now what I can’t figure out is when you’d create an array and you’d need to fill in ‘page_id’ in the args now what I don’t get is when you click different images you get different id’s, what would I need to fill in the args? Here an example of what i’m trying to do:
<?php $args = array( 'page_id' => '', 'posts_per_page' => 1 ); $query = new WP_Query( $args ); if ( $query->have_posts()) : while ( $query->have_posts()) : $query->the_post(); ?> <div id="paginawrap"> <div class="pagina"> <div class="clearfix"></div> <div class="col_3"> <div class="thumbs"><?php if ( has_post_thumbnail() ){the_post_thumbnail('thumbnail');} ?></div> <h3></h3> <p></p> </div> <div class="col_6"> <div class="position"> <h1><?php the_title(); ?></h1> <div class="projectinfo"><?php the_content(); ?></div> </div> <div class="clearfix"></div> </div> </div> <?php endwhile; wp_reset_postdata(); endif; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Single.php id calling’ is closed to new replies.