Monthly Archives: August 2015

Transparent background with readable text

It's not good idea to use opacity because the text also inherits opacity's value. One way is to use CSS3 and rgba-property:
background:rgba(255,255,255, 0.3);
It's transparent white - 0.3 is alpha channel and it specifies the opacaty's value.

Differene between WP the_category() and get_the_category()

If you want to get the category with the link use:


If you want to get the category without the link use:
$categories = get_the_category();
 
if ( ! empty( $categories ) ) {
    echo esc_html( $categories[0]->name );   
}
It shows only the main category and not sub-categories. Echoing out only get_the_category will return array. Links: Code reference - get_the_categroy().