Learn WordPress theme creation from scratch step by step in Hindi.
# WordPress Theme Development Part-3 (Custom Post Types & WP_Query Class)
In this tutorial, we will integrate HTML 'News' page into WordPress using 'Custom Post Types'. Then, we will utilize 'WordPress Template Hierarchy' and 'WP_Query' Class to display News on WordPress frontend.
WordPress theme development sometimes also known as Theme Integration and Theme Creation. This process also known as HTML to WordPress conversion.
# Topics & Important links covered in this WordPress Theme Development Part-3:
1) HTML News Template
- https://freewebsitetemplates.com/preview/lawfirm/news.html
2) Creating Custom Post Types (CPT) for News content
- https://wordpress.org/support/article/post-types/
- https://tutorialsclass.com/wordpress-custom-post-types/
- https://developer.wordpress.org/reference/functions/register_post_type/
3) WordPress Template Hierarchy
- https://developer.wordpress.org/themes/basics/template-hierarchy/
4) WP_Query Class
- https://tutorialsclass.com/wordpress-wp-query-class/
- https://developer.wordpress.org/reference/classes/wp_query/
5) Template tags inside Loops to display information
- Loops - https://developer.wordpress.org/themes/basics/the-loop/
- Loops - https://tutorialsclass.com/wordpress-loop/
- Get date - https://developer.wordpress.org/reference/functions/get_the_date/
- Featured Image - https://developer.wordpress.org/reference/functions/get_the_post_thumbnail/
# What is WordPress Custom Post Types:
WordPress Custom Post Types (CPT) is a way to create different types of content similar to Posts and Pages.
Suppose you want to create a News based website. You can either make use of default posts or create a new section called News using WordPress Custom Posts. Once you created Custom Post Types for ‘News’, You can add any number of News items in this section.
If you have used plugins, there are many who adds different custom post types in the Dashboard. For example, ‘WooCommerce’ adds custom post types for ‘products’. ‘Contact Form 7’ also create custom posts for ‘contact forms’.
# WP_Query Class
WordPress WP_Query Class consists of various functions that pull data from the WordPress database when we use The Loop in WordPress template files.
As a WordPress developer, we often need to fetch WordPress content (posts, pages, categories etc) based on different parameters. Here, WP_Query plays an important role to write custom queries and display posts as per our requirement. We can pass an array of arguments before Loop, and the $query object will build the SQL query based on those arguments.
# WordPress Theme Development Part-1 & Part-2
* HTML & CSS
* Navigation Menu
* Dynamic content for Pages
* Dynamic footer content using Widgets
# WordPress Theme Development Part 1:
- https://www.youtube.com/watch?v=vcwPFN1xvx4&t=113s&ab_channel=TutorialsClass
# WordPress Theme Development Part 2:
- https://www.youtube.com/watch?v=FFrjQZdaYWw&ab_channel=TutorialsClass
# WordPress Tutorial - Website
- https://tutorialsclass.com/learn/wordpress/
#wordpress #tutorial #customposttypes #wp_query