Parsley.js Bootstrap 4 configuration

Anyone looking for parsley.js options for bootstrap 4?

$('form.validate').parsley({
successClass: "has-success",
errorClass: "has-danger",
classHandler: function(el) {
return el.$element.closest(".form-group");
},
errorsWrapper: "",
errorTemplate: ""
});

window.Parsley.on('field:error', function() {
this.$element.addClass('form-control-danger');
});

window.Parsley.on('field:success', function() {
this.$element.addClass('form-control-success');
});

Favourite Laravel Packages

I’ve been neck-deep in Laravel 5.2 (followed by 5.3) – bye bye ZF1. Here are some of my favourite packages:

Notable mentions: log-viewer, database backup, flash messages, forms & html

WP Kembara

screenshot

 

I’ve decided to make a new theme for this blog, going for the simple medium-esque look. Theme is free to download at github.

Download or fork from github https://github.com/munettt/wp-kembara

Or if you feel you want to play around with the HTML theme only, grab it here:

https://github.com/munettt/kembara-template

Run npm install, bower install and gulp.

Myshouts – WordPress Shoutbox Plugin

Repost from my old blog munzir.net.
————————————–

I’ve upgraded my shoutbox plugin which now includes some fancy admin color changer or something.

admin

You can see the demo here or play around with my shoutbox ->

Same thing ported to WordPress.

Download: http://wordpress.org/plugins/myshouts-shoutbox/

How To Install?

Extract into wordpress plugins folder. Enable in Admin and you should see “myshouts” under Settings tab.

You can manually put it in your template using or just use it as a widget.

Ps. If it doesn’t look good on your theme, that means your theme was styled badly (ul li stuff ya know) 🙂 Drop me an email if you need any help.

Alleria – Modern Responsive Photoblog WordPress Theme

Here it is. Alleria 1.0. Here are some of the features of the theme.

  • HTML5 & CSS3
  • Minimalistic look
  • Responsive Layout for tablet and and phones
  • Options Panel
  • Custom Widgets
  • Lights toggle for better photo viewing
  • Custom Template for Gallery
  • WordPress menu support
  • Masonry thumbnails
  • Optional Gears widget, page & photo voting integration with photoblogs.com

Download or more info at photoblogs.com. Where’s the live demo?

alleria

Plugin bug

tweetmyposts

My “tweetmypost” plugin had a bug where every time I edited the same post. It would tweet out as a new post. The problem itself lies with the hook “publish_post”. Publish post is triggered on new posts and updated posts.

The solution is to use 3 other hooks.


add_action('future_to_publish','function_name');
add_action('new_to_publish','function_name');
add_action('draft_to_publish','function_name');

That way, you’ve covered all the possibility of a new post but ignoring the edit post trigger.

Responsive Youtube Embed

I saw a few stuff breaking on this site if you view it from an iPhone. The large thumbnail and the youtube embed.

Youtube embeds are iframes with fixed sizes. I thought css cannot fix that since the codes are hardcoded. I was wrong. The solution was quite simple, you need to wrap the iframe with a container and with a little positioning trick, walla.

.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

 

You can read about the article here.

After adding max-width: 100% on the images, it was a tad broken, turns out you need add some other stuff also.


img {
max-width: 100%;
height: auto;
width: auto; /* Fix for IE */
}

"Life is like a camera. Focus only on what is important and you will capture it perfectly."

Social