Showing posts with label wordpress. Show all posts
Showing posts with label wordpress. Show all posts

Display only posts from one category

Wordpress provide query_post() function for alter the default query for display post. query_post() display post based on specified category and other display option like post per page etc.

Following is the code for display only one category post with pagination.
<?php
query_posts('category_name=category1&showposts=50'.'&paged='.$paged);
while ( have_posts() ) : the_post();
 echo '<li>';
 the_title();
 echo '</li>';
endwhile;
?>


How to make Homepage (Front Page) in wordpress ?


This tutorial teaches you how to display the default homepage of showing you the latest blogs & set it to a homepage.
First you will need to make homepage. so sing in to your wordpress.

Add new page
1.   in your wordpress control panel select Page tab
2.   click on Add New Option
3.   Give your page title & add content.
4.   Click on Publish Button 

Set your page as the Homepage (Front Page)
1.   Click On Setting tab
2.   Click on Reading option


3.   At the top of Reading Option show Front Page Displays option
4.   By default Your latest posts is selected.
5.   to set your page as a Homepage Select A static page option.


6.   Select your page from the Front page drop down menu
7.   You can also select post as a Home page (Front Page)
8.   Click on save changes