Useful PHP snippet which allows you to automatically change all your featured image alt tags to post title and improve SEO on your WordPress website.
Useful WordPress resources, tutorials and snippets.
We love to give back to the community and share our experience!
WordPress offers very useful built in functionality where you can specify image size for galleries within dashboard. But, what if you want to automatically change image size for all galleries? Here is a neat solution with just couple of lines of PHP code.
Far all the developers, WordPress has created a nifty function called wp_parse_args which is quite useful when merging two sets of data arrays and is similar to native PHP function array_merge. The only lack of feature is that it is not recursive which makes it unable to handle and merge multidimensional arrays properly. Luckily, here is our solution.
Did you know that WordPress automatically generates multiple archive URLs for your website? While it may be useful in some cases, it may also hurt your SEO by generating duplicated content and unnecessary pages. Luckily, there is a quick and easy solution.
Here is a handy snippet with which you can easily get your current URL on your WordPress website. It doesn’t matter if you are on single post, page, home, archive, custom post or any other WordPress template.