• niel

    (@nielfernandez)


    Hi,

    I am currently working with a custom post type API, and the goal is to fetch the data including the custom post field from API and display on a page using shortcode, the problem is when I do that loop the data it will display let say I have 4 posts it will display 4 times

    Posts from backend WordPress ( ref: https://www.screencast.com/t/HBMLtMSr6se )
    Title 1
    Title 2
    Title 3
    Title 4

    // Loop with API (ref: https://www.screencast.com/t/juquCATM9wv )
    Expected Output:
    Title 1
    Title 2
    Title 3
    Title 4

    // But the bad result ( ref: https://www.screencast.com/t/YSCQUIyEu9 )
    Title 1
    Title 2
    Title 3
    Title 4
    .
    Title 1
    Title 2
    Title 3
    Title 4
    .
    Title 1
    Title 2
    Title 3
    Title 4
    .
    Title 1
    Title 2
    Title 3
    Title 4

    • This topic was modified 2 years, 11 months ago by niel. Reason: arrange
    • This topic was modified 2 years, 11 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘API Loop display multiple times (Custom Post type)’ is closed to new replies.