The following code show how to get WordPress user’s list which role is ‘subscriber’ and first name and billing city of that user is not blank. we can sort the user list by the user custom field. I have used ‘WP_User_Query’ to get the user list and it allows us to add meta query asContinue reading “Sorting WordPress Users list by Custom Field”
Tag Archives: PHP
Add popup in post content
Open functions.php and write following code then save it. now open post where you want to add thickbox. Open pdf file in popup Open image in popup Show inline content in popup box
Install LAMP server on Ubuntu 16.10
Using following steps we can intall Apache , MySQL and PHP on Ubuntu 16.10 system. 1. First install Apache server Open Terminal and write following command
Recursive category tree in php and mysql
Sometime you face problem in php to manipulate hierarchical data. This code will show you that how to display category tree in php. Here Mysql database used to store data. I have used here recursive method which search data in n Level . for example level 1 , level 2 , level 3 , levelContinue reading “Recursive category tree in php and mysql”
Force file download instead of open in browser
We can configure apache servers to force download files instead of shown in browser window. For example if you want to download Image , MP3 file when you click on that file link , you can use following code in .htaccess file. <FilesMatch “\.(mov|mp3|jpg|png|pdf)$”> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch>