Title: Retrieve data from page using specific template
Last modified: August 24, 2016

---

# Retrieve data from page using specific template

 *  [Orange](https://wordpress.org/support/users/leegrant/)
 * (@leegrant)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/retrieve-data-from-page-using-specific-template/)
 * Hi all,
 * I’m creating a portfolio which needs to display and thumbnail, title and link
   to all other portfolio pages using a specific template.
 * This is what I have so far, which manages to retrieve the page title and the 
   featured image just fine. I’m struggling to retrieve the link to that page as
   the_permalink() just returns the link of the page you’re currently on.
 *     ```
       <?php foreach ( $builtins as $page ) : ?>
       			<div class="fw-col-xs-6 fw-col-md-3  remove-column-padding ">
       				<div class="casestudy">
       					<?php if (has_post_thumbnail( $page->ID ) ): ?>
       						<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'single-post-thumbnail' ); ?>
       						<div class="block" style="background: url('<?php echo $image[0]; ?>')">
       							<h3>
       								<a href="<?php echo apply_filters( 'the_permalink', $page->post_permalink, $page->ID ); ?>" title="<?php echo apply_filters( 'the_title', $page->post_title, $page->ID ); ?>">
       									<?php echo apply_filters( 'the_title', $page->post_title, $page->ID ); ?>
       									<span></span>
       								</a>
       							</h3>
       						</div>
       					<?php endif; ?>
       				</div>
       			</div>
       		<?php endforeach; ?>
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [Orange](https://wordpress.org/support/users/leegrant/)
 * (@leegrant)
 * [11 years ago](https://wordpress.org/support/topic/retrieve-data-from-page-using-specific-template/#post-6149789)
 * Any help please?

Viewing 1 replies (of 1 total)

The topic ‘Retrieve data from page using specific template’ is closed to new replies.

## Tags

 * [page templates](https://wordpress.org/support/topic-tag/page-templates/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Orange](https://wordpress.org/support/users/leegrant/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/retrieve-data-from-page-using-specific-template/#post-6149789)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
