Forums

[resolved] offset (3 posts)

  1. evilpupil
    Member
    Posted 1 year ago #

    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

  2. evilpupil
    Member
    Posted 1 year ago #

    nevermind.. problem solved..

  3. PHansen
    Member
    Posted 8 months ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags