Hello friend, welcome to my blog post how to set custom page title for homepage WordPress. When we use a wp_title() function inside title tag and set a custom page template as a front page then we will see a blank page title in your page source code and see your domain name like www.example.com into your page title. So you need to set a custom page title for the homepage. So we can use WordPress filter hook to set page title. The wp_title filter is used to filter the title of the page (called with wp_title()). This filters the text appearing in the HTML title tag (sometimes called the “title tag” or “meta title”), not the post, page, or category title. Read more
Hello friends, welcome to my another blog post how to load inline script after main jQuery in WordPress. If you want to load your inline scripts after main jQuery then what to do. I had a previous blog how to enqueue inline scripts in header where I show you how to load js script using functions.php. But here I show you a conditional statement. If your main js files load then your inline js will load otherwise not. Some times we have to add some inline js scripts to initialize some js functionality. So we need this types of condition. WordPress has a function wp_script_is to check if a script has been registered, enqueued, printed, or is waiting to be printed. So this function did the trick for me. Read more
Hello friends, welcome to my another blog post how to enqueue inline scripts in header WordPress. Before writing this blog I had a big question in my mind that we can enqueue js, css files using wp_enqueue_script and wp_enqueue_style functions. But If we want to enqueue(add) inline js scripts in our theme’s header file using functings.php the how to do that. How we can enqueue inline js scripts in header? So for you people I have a solution. Please follow the below code: Read more
Hello friends, welcome to my another blog post how to show WooCommerce newest product reviews on top. By default, WooCommerce display product reviews in ascending order, means old reviews will come at a top and newest reviews will show at last. So if you want to show your newest reviews on top then what to do. You have to change the review’s order. Below I give you the solution for this issue.
Hello friends, welcome to my another blog post how to set maximum post title length in WordPress. By default, we can put very short or very long title of our WordPress post. There is no restriction from WordPress that you can not put hung post title. But in SEO purpose, we can not set very long for our post. So if you want that your post title should be inside some character length or post title, not more than 60 characters then you are incorrect place. Read more
Hello friends, welcome to my another blog post how to set minimum word to published post in WordPress. When we create a post in WordPress, it is not mandatory to put content in the editor. But if you want to change this functionality then you need to know some basic coding. We can easily do this using WordPress hook add_action and protect someone to post empty content. Read more
Hello friends, welcome to my another blog post how to show most recent post from each Category WordPress. If you want to create a custom page where you want to show most recent post from individual category then you must use below code. This code will help to achieve your solution.
At first I fetch all categories using get_categories() function. Then loop through each category and show recent 10 posts from each category. Read more
Hello friends, welcome to my another blog post how to add extra class to last post WordPress. Few days earlier I was woking with news magazine website in WordPress. Here I got the problem, I have to add an extra class into my last blog post. So I found the solution in google. But did not get proper solution for first 1 hour. Then I suddenly got some solutions from a different blog site. So I want to share the exact solutions with you. You can use this solution to add an extra class, add some div or any other work you want to do on your last post. So Below are the solutions: Read more
Hello friends, welcome to my another blog post how to get page id from page name WordPress. If you have your page name or page title and you need to find page id from that, WordPress does not have any default function for that. Where you pass the page name or page title and get your respective page id. Here I create a custom function for you to get page id from page name and page title. You can use my function with wp_list_pages WordPress function to be excluded from the list of pages or included your specific page. Read more
Hello friends, welcome to my another blog post how to open contact form 7 in popup. Recently I was working on a project for my client and he need a inquiry button. When ever user click on this button a form will popup. I know it can be done with contact form 7 and any jQuery plugin like fancybox, lightbox etc. So I was searching for WordPress plugins for this and I got one plugin “Form Lightbox” and my issue was solve. So today I will tech you step by step process to open contact form 7 in popup. Read more