WordPress REST API V2 only return 10 posts

Published

path = ‘https://blogcms/wp-json/wp/v2/media’;

ngOnInit(): void {
this.titleService.setTitle(‘Cloobot – Blog.’);
this.meta.updateTag({ name: ‘description’, content: ‘Cloobot is a project management software that helps companies manage the schedule, resource allocation, control the workload and plan future projects. Start your free trial.’});
this.meta.updateTag({ name: ‘keywords’, content: ‘Blog, Automatic task allocation software, Project management software, ProjectManagement Tool.’});

this.restApi.GetBlog().subscribe(res => {
  this.data = res;
  // console.log(this.data, 'datadatdat');
  if (this.data.length !== 0) {
    // tslint:disable-next-line:prefer-for-of
    for (let i = 0; i < this.data.length; i++) {
      fetch(this.data + "?page=" + i)
      if (this.data[i].featured_media !== 0 ) {
        this.restApi.getBlogImage('https:///wordpress/wp-json/wp/v2/media/'
          // tslint:disable-next-line:no-shadowed-variable
          + this.data[i].featured_media).subscribe(res => {
        // console.log(res.guid.rendered, 'imag');
        this.data[i].thums =  res.guid.rendered;
        });
      } else {
        this.data[i].thums =  'assets/image-not-found.jpg';
      }
    }
    // console.log(this.data, 'all data');
  }
});

}

Source: Angular Questions

Published
Categorized as angular, wordpress Tagged ,

Answers

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq