WordPress REST API – custom routes & endpoints

The WordPress REST API has revolutionized how developers interact with WordPress sites, offering a robust set of endpoints for managing content and performing various operations. While the API comes with a predefined set of routes for core functionalities, developers often need to create custom routes and endpoints to extend WordPress’ capabilities and meet specific project […]

Contact Form 7 AJAX Callback

And the valid events are: wpcf7invalid — Fires when an Ajax form submission has completed successfully, but mail hasn’t been sent because there are fields with invalid input. wpcf7spam — Fires when an Ajax form submission has completed successfully, but mail hasn’t been sent because a possible spam activity has been detected. wpcf7mailsent — Fires when an Ajax […]

How to get a site url in WordPress code?

Getting the Site’s URL Let’s say your site’s URL is http://example.com. If you want to print this out in the source, you can use the url parameter. This works great for absolute link references. For example, if you wanted to reference your logo (let’s say the file name is logo.png) that is in a directory called images, you would do […]

How to get the url of current theme?

Getting the URL to the Current Theme To grab the current theme directory’s URL, you can use the template_url parameter. This makes your WordPress themes more flexible so that when you change the domain name or use it in multiple domain names you don’t have to worry about changing anything that references the theme’s location. You can use this […]

Displaying Common Information using common functions in wordpress?

Now let’s move on to some more functions we can use inside the loop. Many of these functions can only be used inside the loop and may not work if used outside of it. Display the title of the post: Display the URL of the post: Display the content of the post: Display the excerpt […]

Custome Menubar Support in wordpress

The navigation menu feature, introduced in WordPress 3.0, allows for the intuitive creation and maintaining of navigation menus in themes.At the very least, a standard theme will need a main navigation menu, perhaps in the header and a secondary navigation menu in the footer. To do this, we will register those two menus “Main Menu” […]

Custom avatar support in wordpress?

Most people commenting on blogs online have an avatar associated with them. If, however, they don’t and you don’t particularly like the WordPress default avatar options, you can define your own.To do so, include the following code in your functions.php: What we’re doing here first, is checking to see if the function exists. If it does, […]