• Twitter
  • Facebook
  • Google+
  • Instagram
  • Youtube

Saturday, 23 July 2016

How to Create a Page that Displays Random Posts

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:
01<?php
02query_posts(array('orderby' => 'rand''showposts' => 1));
03if (have_posts()) :
04while (have_posts()) : the_post(); ?>
05
06<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
07
08<?php the_content(); ?>
09
10<?php endwhile;
11endif; ?>
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.

Services

What can I do


SEO SERVICES

Our team is well trained in different SEO strategies and helps the client to follow right SEO techniques and increase the website traffic in less time. This contributes to generation of high traffic on the website by complete utilisation of SEO and hence helps the website owner to utilise this traffic in earning revenue by Google Adsense.

Web Design

ADONAI Infotech gained a prestigious name owing to its brilliance and efficiency in web development services. Our web development services cover these primary aspects like Client side coding, Server side coding, Client and server side coding, Data base technology, Practical web development, Security considerations & many more.

Graphic Design

Graphics & Logos are the identity of a brand and it speaks about the reputation of the firm though its design. Hence ADONAI Infotech with its team of brilliant logo or graphics designers meet the demands of the customers and produce remarkable logos. Hence we are the most desirable graphics designing company in Saharanpur.

Development

We are an emerging Android & iOS App developer company in Saharanpur. People are opting for us because of our dedicated work. Our team tries its best to create an app meeting the client needs. We are expert in making apps like Shopping, Fashion, Books, Social Networking, Social Media, Music, Multimedia, Health, Travel, Food, etc.

Media Promoters

We as a Social & Internet media buyer we will negotiate, purchase and monitor advertising space and airtime on behalf of clients desire. Our aim is to reach the highest number of people in the target audience at the lowest possible cost. ADONAI Infotech is standalone Internet & Social Media buyers in Saharanpur or in nearby localities.

User Experience

We delievered more than 18 projects uptill now & all the clients are quite satisfied. We as a team are always their for you to solved any kind of issues within 24 Hours via mail or Phone support. Which made us really appreciable by ours Clients. Beside this we help them in providing good quality traffic at the lowest possible price.

Contact

Get in touch with Adonai Infotech


Adress/Street

Mission Compound, Saharanpur, India Pin-247001

Phone number

+(91) 879 143 0948

Website

www.ashishharrison.com