• missill

    (@missill)


    Hi,
    I have a strange issue that i don’t really understand, I explain : In my tag.php, i have an infinite scroll with custom post types thanks to the active tag and ajax.

    I do the same get_posts in functions.php in my ajax function :

    $posts = get_posts( array(
        'post_type' => 'video',
        'posts_per_page' => 6,
        'paged' => 1,
        'post_status' => 'publish'
    )) ;

    This simple get_posts not returning same values !
    I replaced ‘paged’ with ‘offset’ and nothing changed !
    How it’s possible ? What i forgot ?
    If i add ‘order’ => ‘ASC’ and ‘orderby’ => ‘ID’ for example, it’s the worst !
    Any ideas ? Thanks for help me.

Viewing 1 replies (of 1 total)
  • Thread Starter missill

    (@missill)

    I found that it’s my ajax function in functions.php which is responsable but i don’t know why !

Viewing 1 replies (of 1 total)
  • The topic ‘same get_posts function works diffrently in tag.php and functions.php’ is closed to new replies.