BEM colors:

  • .primary
  • .secondary
  • .tertiary
  • .light
  • .dark

BEM code sample:

<div class="c-card">
  <img class="c-card-img" src="">
  <div class="c-card-header">
  <div class="c-card-body">
    <h4 class="c-card-title">Card title</h4>
    <div class="c-card-text">Card additional content.</div>
    <a href="#" class="button button-primary">Link</a>
  <div class="c-card-footer">
    Posted 12 days ago

Debugging the issue

Try to isolate the issue. Copy the code that you have issues with and paste it into the clean page template.

Can you still reproduce the issue? If no – than you are missing some code from the main template. If you still can reproduce the issue than continue reading.

Now you need to start removing parts that you think are irrelevant. You should remove parts one by one with fairly small pieces of code. Refresh the page after each code remove and check if you still can reproduce the issue.

Can you still reproduce the issue? If yes – try to remove the next piece of code. If no – bring the last removed piece of code (with Ctrl+Z or what ever hot key is in your laptop). Now you found the piece of code where the issue might be. This should give you a clue to locate the issue and ways to fix it.

image placeholder


&lt;img src=""&gt;


Holder.js – works offline, uses svg


<img data-src="holder.js/256x113?bg=#b4e6ca&amp;fg=#90b8a1" alt="256x113" src="data:image/svg+xml;charset=UTF-8," data-holder-rendered="true">





Guiding Principles:

  • Changelogs are for humans, not machines.
  • There should be an entry for every single version.
  • The same types of changes should be grouped.
  • Versions and sections should be linkable.
  • The latest version comes first.
  • The release date of each version is displayed.
  • Mention whether you follow Semantic Versioning.

Types of changes:

  • [Added] for new features.
  • [Changed] for changes in existing functionality.
  • [Deprecated] for soon-to-be removed features.
  • [Removed] for now removed features.
  • [Fixed] for any bug fixes.
  • [Security] in case of vulnerabilities.


Adding custom attributes to script and stylesheets tags

function custom_attr_style( $html, $handle, $href, $media ) {
    $handles = array('twentyeleven-style'); // stylesheet handle
    if( in_array( $handle, $handles ) ) {
        $html = str_replace(' href=', ' async href=', $html); // added custom attribute
    return $html;
add_filter( 'style_loader_tag',  'custom_attr_style', 10, 4 );
function custom_attr_script( $html, $handle, $src ) {
	$handles = array('twentyeleven-script'); // script handle
    if( in_array( $handle, $handles ) ) {
        $html = str_replace(' src=', ' async src=', $html); // added custom attribute
    return $html;
add_filter( 'script_loader_tag', 'custom_attr_script', 10, 3 );

Optimizing Contact Form 7

Loading Contact Form 7 CSS and JavaScript files on pages with specific slugs only:

// Deregistering Contact Form 7 CSS files on all pages without a Contact form
add_action( 'wp_print_styles', 'universio_cf7_deregister_styles', 100 );
function universio_cf7_deregister_styles() {
    if ( ! is_page( array( 'contact', 'contact-us', 'feedback' ) ) ) {
        wp_deregister_style( 'contact-form-7' );

// Deregistering Contact Form 7 JavaScript files on all pages without a Contact form
add_action( 'wp_print_scripts', 'universio_cf7_deregister_javascript', 100 );
function universio_cf7_deregister_javascript() {
    if ( ! is_page( array( 'contact', 'contact-us', 'feedback' ) ) ) {
        wp_deregister_script( 'contact-form-7' );

Code Coverage

You can check the CSS and JS code coverage with Chrome Dev Tools:

You can show the Coverage tab from Dev Tools menu by choosing “More tools” => “Coverage”.

Alternatively, to open Dev Tools press Cmd+Opt+I (Mac) or Control+Shift+I (Windows, Linux). After this, you can access the Coverage from the Command Menu: Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows, Linux) and then typing “Show Coverage”.


Checkout the “feature/branch-001” branch:

  • git pull origin feature/branch-001
  • git checkout -f feature/branch-001


  • git add . (add all files for a commit)

  • git commit -m “Minor code updates”


  • git push

Reset recent commit:

  • git reset –hard

Get latest develop branch into your branch:

  • git pull origin develop

Get latest version of styles.css file from develop branch:

  • git pull origin develop web/css/styles.css

Create new branch:

  • git checkout -b feature/branch-001 (-b flag means creating a new branch. By default, the new branch is based upon whatever branch you were on.)
  • git checkout -b new-branch existing-branch (create new-branch off the existing-branch)