Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.68 KB | None | 0 0
  1. <div id="gurock-blog-posts"></div>
  2. <script>
  3.     var settings = {
  4.         "async": true,
  5.         "crossDomain": true,
  6.         "url": "https://blog.gurock.com/wp-json/rxwo/v1/latest-posts/?cat=92&numberposts=2",
  7.        "method": "GET",
  8.        "headers": {
  9.        }
  10.    };
  11.     var container = jQuery("#gurock-blog-posts");
  12.     jQuery.ajax(settings).done(function (response) {
  13.         jQuery.each( response, function(k,v){
  14.             container.append("<div class='news-title'><a href='"+ v.link +"'>" +  v.title + "</div>");
  15.             container.append("<p class='news-content'>" + v.content + "</p>");
  16.         });
  17.     });
  18. </script>
  19.  
  20.  
  21.  
  22.                                 </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement