Step by step guide to create custom category page in wordpress without plugin
Custom category page is boost you WordPress theme customization . With create a custom category page you can give a unique look to each category of wordpress .
When developer create a new wordpress theme then he/she has a dream to create custom category pages in its theme . In This wordpress tutorial i tell you how to create custom category page without using any plugin .
Create New PHP File
You cann’t create new theme page from wordpress dashboard . So login to your cPanel . Go to file manager . Then go to public_html folder .
Know go to wordpress installation folder . If you don’t know installation folder of your wordpress read this article . Got to your wp-content folder .
In wp-content go to themes folder and then go to your current theme folder .
Create a new .php file under you current theme in which you want to create custom category page . Now the most important thing is .php file name .
Choose File Name For Custom Category Page
Suppose you have a category name “wordpress ” on your website . And you want to create a custom category page for this category . Then your new php file name is category-wordpress.php .
Know understand the custom category file name . File file name must start from “category- ” and second word is your category name . It also must existed on your website . And it is also case sensitive .
Your category-wordpress.php is now custom category page for category name wordpress . When user click on this category . category-wordpress.php is loaded . But when clicked on other category , category.php page is loaded .
Minimum Functions For New Created .PHP File
But at this time custom page is not working well . Because no code exist inside this php file . It is displayed in Appearance >Editor . Click on editor and click on category-wordpress.php .
Place the php code inside your custom category file . Minimum code to for this page as follows .
<?php get_header(); ?> <?php get_sidebar(); ?> <?php get_footer(); ?>
This minimum code is required to run your custom file . Know go to your website and check the specific category page for which you create custom page .
Your custom category page is working but only header ,sidebar and footer is displayed . Know you can place any custom codes for your custom category page .
But all the upper three functions must required . All of your custom code place between anywhere in header and footer .
See the video for detailed help on create custom category page .