Title: Query Question
Last modified: August 21, 2016

---

# Query Question

 *  [dwharrington](https://wordpress.org/support/users/dwharrington/)
 * (@dwharrington)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/query-question-3/)
 * I am using a theme called Yasmin and I want to use a custom query that I need
   help with. Obviously, I’m not a coder.
 * Yasmin creates a special category of content called portfolio that it uses to
   display featured images and text in a certain way that I like.
 * It also has a front page slider that draws images and text from posts. I would
   like to hack it so that the slider draws images and text from portfolio but am
   unsure how. I think a query could do it and someone who knows WordPress could
   tell me how:
 * **Here is how the theme queries portfolio pages:**
 *     ```
       <?php 	$query = new WP_Query( array( 'post_type' => 'portfolio','posts_per_page' =>'3' ) );
       	           	if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post();	?>
       ```
   
 * **Here is how the theme queries slider images:**
 *     ```
       <?php 	$count = of_get_option('w2f_slide_number');
       				$slidecat = of_get_option('w2f_slide_categories');
       				$query = new WP_Query( array( 'cat' => $slidecat,'posts_per_page' =>$count ) );
       	           	if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post();	?>
   
       		<li>
       				<?php $image_attr = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'top_feature'); ?>
       				<a href="<?php the_permalink() ?>">	<img src="<?php echo $image_attr[0]; ?>"></a>
   
       				<div class="flex-caption">
       					<h3> <?php the_title(); ?></h3>
       				</div>
   
       		</li>
       ```
   

The topic ‘Query Question’ is closed to new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [dwharrington](https://wordpress.org/support/users/dwharrington/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/query-question-3/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
