Title: apascal's Replies | WordPress.org

---

# apascal

  [  ](https://wordpress.org/support/users/apascal/)

 *   [Profile](https://wordpress.org/support/users/apascal/)
 *   [Topics Started](https://wordpress.org/support/users/apascal/topics/)
 *   [Replies Created](https://wordpress.org/support/users/apascal/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/apascal/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/apascal/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/apascal/engagements/)
 *   [Favorites](https://wordpress.org/support/users/apascal/favorites/)

 Search replies:

## Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to “save” variable values across functions?](https://wordpress.org/support/topic/how-to-save-variable-values-across-functions/)
 *  Thread Starter [apascal](https://wordpress.org/support/users/apascal/)
 * (@apascal)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/how-to-save-variable-values-across-functions/#post-1473143)
 * I didn’t know you were supposed to declare a variable globally in the first function!
 * Thanks a lot 🙂
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Excluding Posts Using a Variable Between Functions](https://wordpress.org/support/topic/excluding-posts-using-a-variable-between-functions/)
 *  Thread Starter [apascal](https://wordpress.org/support/users/apascal/)
 * (@apascal)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/excluding-posts-using-a-variable-between-functions/#post-1470803)
 * How would I do that? I can just do a WP_Query that lists posts that **don’t**
   have the meta value but then if in the database there are more “featured” posts
   than what the user specifies to be displayed in the slider, they will just not
   appear anywhere.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Excluding Posts Using a Variable Between Functions](https://wordpress.org/support/topic/excluding-posts-using-a-variable-between-functions/)
 *  Thread Starter [apascal](https://wordpress.org/support/users/apascal/)
 * (@apascal)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/excluding-posts-using-a-variable-between-functions/#post-1470680)
 * Well, the thing is, this a theme that will be sold so as a developer, I don’t
   know how many posts will be set to be displayed on the homepage. That being said,
   I also don’t know how many featured posts will be set, and of the number that
   is set, how many will actually have the “featured” meta value.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Excluding Posts Using a Variable Between Functions](https://wordpress.org/support/topic/excluding-posts-using-a-variable-between-functions/)
 *  Thread Starter [apascal](https://wordpress.org/support/users/apascal/)
 * (@apascal)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/excluding-posts-using-a-variable-between-functions/#post-1470678)
 * Thanks, it works now! There’s a side-effect to that though. For example, if in
   the Settings it’s set to display 5 entries per page, and 3 of those entries are“
   featured” posts, only 2 entries show up instead of 5 non-featured post showing
   up.
 * I’m sure there’s an easy fix to that. Any help?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Excluding Posts Using a Variable Between Functions](https://wordpress.org/support/topic/excluding-posts-using-a-variable-between-functions/)
 *  Thread Starter [apascal](https://wordpress.org/support/users/apascal/)
 * (@apascal)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/excluding-posts-using-a-variable-between-functions/#post-1470676)
 *     ```
       // 'The Loop' Posts
       function com_post() {
   
       	global $post, $posts, $com_posts, $featured_ID;
   
       	if (have_posts()) : while(have_posts()) : the_post();
   
       		loop code goes here...
   
       	}
   
       	endwhile;
   
       	endif;
   
       }
   
       // Featured Slider Posts
       function com_featured() {
   
       	global $post, $posts, $com_featuredPostsNum;
   
       	$args = array(	'meta_value'=> 'on',
       			'meta_key'=> 'featured_value',
       			'post_type' => 'post',
       			'post_status' => 'publish',
       			'posts_per_page' => $com_featuredPostsNum,
       			'caller_get_posts'=> 1
       		     ); 
   
       	$featured = null; $featured = new WP_Query($args); 
   
       	if ($featured->have_posts()) { 
   
               while ($featured->have_posts()) : $featured->the_post(); $featured_ID = $post->ID; 
   
       		loop code goes here...
   
       	endwhile;
   
       	} wp_reset_query();
   
       }
       ```
   
 * How can I exclude the posts displayed in the featured post query from the general
   Loop? These functions are in functions.php by the way.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Excluding Posts Using a Variable Between Functions](https://wordpress.org/support/topic/excluding-posts-using-a-variable-between-functions/)
 *  Thread Starter [apascal](https://wordpress.org/support/users/apascal/)
 * (@apascal)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/excluding-posts-using-a-variable-between-functions/#post-1470673)
 * Hmm… that didn’t work. After I applied that, nothing showed up at all from the
   Loop. Any other ideas?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How can I arrange my blog posts like this? (picture attached)](https://wordpress.org/support/topic/how-can-i-arrange-my-blog-posts-like-this-picture-attached/)
 *  [apascal](https://wordpress.org/support/users/apascal/)
 * (@apascal)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/how-can-i-arrange-my-blog-posts-like-this-picture-attached/#post-1470138)
 * A simpler solution is having a container the size you want. Then inside, create
   another container that is wide enough to fit the entries with margins. That way,
   the entries will fit with no hacks, but the original container with whatever 
   background you had will remain the same.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Featured Post](https://wordpress.org/support/topic/featured-post-4/)
 *  Thread Starter [apascal](https://wordpress.org/support/users/apascal/)
 * (@apascal)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/featured-post-4/#post-1470590)
 * Another question, how can I make it so if the $post->ID of a post in The Loop
   matches with **any** of the post ID’s in the featured post Query, it doesn’t 
   display?
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Custom Query Help](https://wordpress.org/support/topic/custom-query-help-1/)
 *  Thread Starter [apascal](https://wordpress.org/support/users/apascal/)
 * (@apascal)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/custom-query-help-1/#post-1382954)
 * Works like a charm! Thanks so much!

Viewing 9 replies - 1 through 9 (of 9 total)