Author Archives: admin

About admin

Just another php developer trying to give something back to the community.

WordPress query posts my meta data

Description: On a WP powered site, if you add custom meta information, you might want to query the posts that have a particular meta information, like a custom post template. Solution: This is done very easy and safe using the … Continue reading

Posted in Wordpress | Tagged , , | 1 Comment

nginx index inside conditional location

Description: On a server that delivers multiple sites, I need to set up the location of a request depending on the host. For example I need to serve different text depending on the site language. Solution: The only problem here … Continue reading

Posted in Best practices, nginx, System | Tagged , | Leave a comment

Facebook Instant Articles feed not being crawled

Description: After installing in WordPress one of the Facebook Instant Articles plugins, the feed can be seen in browser at but the Facebook publishing tool can’t crawl it. Solution: Of course this can be a due to a series … Continue reading

Posted in Wordpress | Tagged , , , | Leave a comment

Check database tables size in Mb

Description: How can I check the size of my database tables and receive a human readaable result? This can be useful when deciding a storage architecture or a Cloud storage plan. Solution: From command line, go to mysql> terminal: SELECT … Continue reading

Posted in SQL | Tagged , | Leave a comment

WordPress proper query_posts with real results

Description: WordPress query_posts() function is pretty powerful, and easy to read out. However, you need to know what you’re querying for, as very often the results are not the expected ones. The specific post meta query is covered here. Solution: … Continue reading

Posted in Wordpress | Tagged , , , , | Leave a comment

Retrieve coordinates when click on image

Description: HTML forms allow the use of an image as a submit button, and the action triggers the send of the x and y coordinates of the click relative to the image size. However, why not take it to the … Continue reading

Posted in Javascript, Script | Tagged , , , | Leave a comment

Change button text value on HTML input type file

Description: Browsers render by default “Choose file” (or similar, depending on browsers and locale settings) when an input of type “file” is detected. Solution: Unfortunately there is no easy solution.  <input type=”file” name=”inputFile” id=”inputFile” /> This is pretty much all … Continue reading

Posted in Best practices | Tagged , , | Leave a comment