Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <!-- Add the following three tags inside head -->
- <!--[if lt IE 7]><html class="ie6 oldie"><![endif]-->
- <!--[if IE 7]><html class="ie7 oldie"><![endif]-->
- <!--[if IE 8]><html class="ie8 oldie"><![endif]-->
- <!--[if gt IE 8]><!--><html lang="en"><!--<![endif]-->
- <head>
- <!-- Update your html tag to include the itemscope and itemtype attributes. -->
- <title>WordPress 'Get_Posts()' function Debug Test</title>
- <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
- <link rel="stylesheet" href="https://soldierupdesigns.com/css/bootstrap.min.css" type="text/css" media="screen">
- <link href="https://soldierupdesigns.com/css/style.min.css" rel="stylesheet" type="text/css" media="all">
- <?php
- function getwpposts()
- {
- // Include WordPress
- define('WP_USE_THEMES', false);
- require('./blog/wp-blog-header.php');
- query_posts('showposts=10');
- }
- ?>
- <?php
- //get PHP WordPress function from above
- getwpposts();
- ?>
- </head>
- <body>
- <div class='container'>
- <h3>
- Test of WordPress <code>get_post()</code> function
- </h3>
- <?php
- if(function_exists("getwpposts")) echo " 'getWpPosts()' function is defined.n";
- else echo " 'getwpposts()' function is not defined.n";
- ?>
- <br />
- <div id="row" class='row'>
- <?php while (have_posts()): the_post(); ?>
- <div class="dateIcon">
- <h5><?php the_time('M'); ?></h5>
- <p><?php the_time('j'); ?></p>
- </div>
- <div class="text">
- <h4><?php the_title(); ?></h4>
- <p><?php the_excerpt(); ?></p>
- <a href="<?php the_permalink(); ?>">Read More...</a>
- </div>
- <br />
- <?php endwhile; ?>
- </div>
- <br />
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement