Have you ever been to a site and saw this cool feature? They have a link in their top navigation to something like Stumbe! or Read Random Articles, or some other creative text. When you click on that link, it takes you to a page that displays one random page. Each time you refresh, you are delivered with a new post. Well this trick is just for you then.
You would need to follow the trick #1 in this article to create a custom page template. And simply paste this code in there:
(have_posts()) : the_post(); ?>
"<?php the_permalink() ?>"
><?php the_title(); ?></a></h1>
<?php the_content(); ?>
This is a simple WordPress Loop that is running a query to display random posts and the number 1 in there is telling WordPress to only show 1 post. You can change that number, but most of the time people do it one post a time.
We have a Quick Reading Page on our site as well, so you can see this trick in action.
3. How to Display any External RSS Feed on Your Site
Have you seen other bloggers who display their other blog’s feed on their site. You want to do it too for extra promotion and traffic. Well here is the tutorial for you. Simply paste the following code in anywhere in your theme:
) : ?>
'<?php echo $item->get_permalink(); ?>'
'<?php echo '
j F Y | g:i a
4. How to Display Relative Dates in WordPress
Have you ever seen this in blog posts and comments and wondered how did this blogger manage to do this? Actually it is pretty easy.
You would need to download a plugin called WP-Relative Date
Once you have downloaded and activated the plugin, look in your single.php, index.php, and page.php for this code:
Replace it with:
<?php relative_post_the_date(); ?>