Posts under Open Source

WordPress: How to upload image using script?

advertisement

wordpressJust migrated an old site to WordPress. This old website contain more than 1200 images and if i migrate manually it will take a long time. So i wrote two script, first to extract all the images and it’s description from the old website to a file. And second script is a WordPress plugin script to upload the image to it’s page and set the image caption (useful for gallery and lightbox description) according to the old website description automatically.

wordpress-upload-image-script

How to upload image using script in WordPress

Continue reading WordPress: How to upload image using script? »

Composer: PHP Fatal error: Allowed memory size of … exhausted…

advertisement

phpIf you are using composer in your php project, you might encounter the the same error as mine.

PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 71 bytes) in phar:///sf2projects/myproject/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 47

To solve this PHP fatal error allowed memory size exhausted problem, refer to the solution below:-

Continue reading Composer: PHP Fatal error: Allowed memory size of … exhausted… »

Bootstrap 3: Responsive image align center

advertisement

bootstrapIf you are using Bootstrap 3, you might come into a problem where you can use .text-center to align text to center but not image. There are many different work around to solve this issue including wrapping the image within a .text-center div or overriding the .img-responsive class. Although there are many different work around to align image to center in Bootstrap 3, i just found a very convenient way to solve this issue.

bootstrap-center-image

To align image to center in Bootstrap 3, you can try the code below:-

Continue reading Bootstrap 3: Responsive image align center »