Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. <html>
  2. <!-- Add the following three tags inside head -->
  3. <!--[if lt IE 7]><html class="ie6 oldie"><![endif]-->
  4. <!--[if IE 7]><html class="ie7 oldie"><![endif]-->
  5. <!--[if IE 8]><html class="ie8 oldie"><![endif]-->
  6. <!--[if gt IE 8]><!--><html lang="en"><!--<![endif]-->
  7. <head>
  8. <!-- Update your html tag to include the itemscope and itemtype attributes. -->
  9. <title>WordPress 'Get_Posts()' function Debug Test</title>
  10. <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
  11.  
  12. <link rel="stylesheet" href="https://soldierupdesigns.com/css/bootstrap.min.css" type="text/css" media="screen">
  13. <link href="https://soldierupdesigns.com/css/style.min.css" rel="stylesheet" type="text/css" media="all">
  14. <?php
  15. function getwpposts()
  16. {
  17. // Include WordPress
  18. define('WP_USE_THEMES', false);
  19. require('./blog/wp-blog-header.php');
  20. query_posts('showposts=10');
  21. }
  22. ?>
  23. <?php
  24. //get PHP WordPress function from above
  25. getwpposts();
  26. ?>
  27. </head>
  28. <body>
  29. <div class='container'>
  30. <h3>
  31. Test of WordPress <code>get_post()</code> function
  32. </h3>
  33. <?php
  34. if(function_exists("getwpposts")) echo "&nbsp;'getWpPosts()'&nbsp;function is defined.n";
  35. else echo "&nbsp;'getwpposts()'&nbsp;function is not defined.n";
  36. ?>
  37. <br />
  38. <div id="row" class='row'>
  39. <?php while (have_posts()): the_post(); ?>
  40. <div class="dateIcon">
  41. <h5><?php the_time('M'); ?></h5>
  42. <p><?php the_time('j'); ?></p>
  43. </div>
  44. <div class="text">
  45. <h4><?php the_title(); ?></h4>
  46. <p><?php the_excerpt(); ?></p>
  47. <a href="<?php the_permalink(); ?>">Read More...</a>
  48. </div>
  49. <br />
  50. <?php endwhile; ?>
  51. </div>
  52. <br />
  53. </div>
  54. </body>
  55. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement