How to Add Background Images in WordPress – as Like CSS

PHP code cannot run in .css file, however you can use inline style, such as: [php]<div style="background-image: url("<?php //url ?>");">[/php] OR [css].class-name { background-image: url("<?php //url ?>"); }[/css] The above would be useful when working with custom fields for dynamic image paths. If the image is located in the theme directory, PHP won’t be needed, let’s say … Read more

‘hr’ right aligned next to text – CSS

Explanation: Here, the main part is to use overflow: hidden; on the element, and than am creating a virtual element using an :after pseudo with content property, and am positioning it absolute to the parent element which am setting to relative [php]<h2>Hello World</h2>[/php]   [css]h2 { font-size: 20px; font-family: Arial; position: relative; overflow: hidden; } h2:after { display: inline-block; content: ""; height: 4px; background: … Read more

Custom order status background button color in WooCommerce 3.3 admin order list

You can set CSS color and background color to your custom order status displayed in admin order list this way: [php]add_action(‘admin_head’, ‘styling_admin_order_list’ ); function styling_admin_order_list() { global $pagenow, $post; if( $pagenow != ‘edit.php’) return; // Exit if( get_post_type($post->ID) != ‘shop_order’ ) return; // Exit // HERE we set your custom status $order_status = ‘Dispatched’; // … Read more

How to Resizing Image in Bootstrap Carousel

The reason why your image is resizing which is because it is fluid. You have two ways to do it: 1. Either give a fixed dimension to your image using CSS like: [css].carousel-inner > .item > img { width:640px; height:360px; }[/css] 2. A second way to can do this: [css].carousel { width:640px; height:360px; }[/css] [custom-related-posts … Read more

How to Hide Added to Cart message in WooCommerce

Update for WooCommerce 3+ The hook wc_add_to_cart_message is deprecated and replaced by wc_add_to_cart_message_html. You can use the following (compact effective way): [php]add_filter( ‘wc_add_to_cart_message_html’, ‘__return_false’ );[/php] Or the normal way: [php]add_filter( ‘wc_add_to_cart_message_html’, ’empty_wc_add_to_cart_message’); function empty_wc_add_to_cart_message( $message, $products ) { return ”; }; [/php] Before WooCommerce 3, use this: Removing only the message (pasting it to your function.php file inside … Read more