Title: offset
Last modified: August 19, 2016

---

# offset

 *  Resolved [evilpupil](https://wordpress.org/support/users/evilpupil/)
 * (@evilpupil)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/offset/)
 * hi, i’m not good with php so please bare with me. i got problem with my coding.
   i try to use a custom variable in a get_post function, but it’s not working.
 * example:
 * >  <?php $testa = 5 ;?>
   >  <?php $testb = 10 ;?>
   > <?php $posts = get_posts(‘numberposts=$testa&offset=**$testb**‘); foreach (
   > $posts as $post) : start_wp(); ?>
 * but only the $testa is called correctly in numberposts but not the $testb. how
   can i fix this?
 * please help
    thank you

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

 *  Thread Starter [evilpupil](https://wordpress.org/support/users/evilpupil/)
 * (@evilpupil)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/offset/#post-887797)
 * nevermind.. problem solved..
 *  [phansen](https://wordpress.org/support/users/phansen/)
 * (@phansen)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/offset/#post-888009)
 * Yay, good for you. But this post won’t help many others.. WP should remove posts
   like this if the member doesn’t write the solution.

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

The topic ‘offset’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [phansen](https://wordpress.org/support/users/phansen/)
 * Last activity: [17 years, 2 months ago](https://wordpress.org/support/topic/offset/#post-888009)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
