How To Exclude Posts and Pages in WordPress Search

Sometimes we don’t want to display every page and post in search results. Today I like to explain you how to add filter to the search. For this I have added a filter to the search query of WordPress and exclude posts or pages as per my requirement of the search result. We can exclude […]

How to get thumbnail of YouTube video link using YouTube API?

Each YouTube video has 4 generated images. They are predictably formatted as follows: The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is: For the high quality version of the thumbnail use a url similar to this: There […]

Let’s Create a Custom Post Type !

Here we shall create a custom post type which will display portfolio. Lets started. Register Your Custom Function. Open your function.php of current theme. At the end of the function file, type the following line of code to execute the custom function named create_portfolio during the initialization phase every time a page is generated. Function […]

How to create a custom page template in wordpress ?

All custom page templates must start with the following code. It tells WordPress that the file is a custom page template, and sets the name of the template. Note: you can change Template name as per your requirement. just put the name which you want at the front of the “Template name:” File Creating In […]

Create WordPress Custom Post Type Archive PageTemplates

Post Type Templates Custom Post Type Templates archive-{post_type}.php single-{post_type}.php archive-{post_type}.php  If the custom post type were ‘product’, WordPress would look for archive-product.php to display the archive of posts. single-{post_type}.php  If the custom post type were ‘product’, WordPress would look for single-product.php to display the single or permalink of the post. If these files are not […]