wordpress

How to add background image dynamically in WordPress

add this code to your wordpress function.php file // Output style function print_theme_extra_styles() { global $post; $bg = get_post_meta( $post->ID, ‘background’, true ); if( $bg ) : ?> <style type=”text/css”> .example-class { background-image: url(<?php echo $bg;?>); } </style> <?php endif; } add_action( ‘wp_print_styles’, ‘print_theme_extra_styles’ ); and add .example-class to your element where you want to…

Continue reading →


Open Bootstrap submenu on mouse over

Bootstrap Bootstrap comes with a cool CSS menu which support submenu’s out of the box. The only behaviour I almost always need to change is when the submenu should be displayed. By default the submenu is displayed when clicked on on it’s parent menu item, but I want it to open when mouse hovering the…

Continue reading →