How Do I Add a Floating Box in WordPress?

Adding a floating box to WordPress is a relatively simple process. To start, open the WordPress admin area and navigate to the “Appearance” tab.

Here, you will find a section titled “Floating Box” (see Figure 1).

To add a floating box to your site, first select the “Floating Box” option from the drop-down menu and then enter the desired dimensions in the corresponding fields (see Figure 2).

Next, you will need to add a custom CSS rule to your site’s header. To do this, open your site’s header file (usually located at wp-config.php) and add the following code:

/* Add a custom CSS rule for the floating box */

add_action( ‘wp_head’, ‘my_custom_rule_for_floating_box’ );

Finally, add the following code to the my_custom_rule_for_floating_box function:

/* Add the floating box css rule */

wp_style( ‘floating-box’, ‘margin: 1em 0; padding: 1em; border: 1px solid #ddd;’ );

When you’re finished, your site should look like Figure 3.

Now that you’ve added a floating box to your WordPress site, be sure to check out the “Conclusion” section for tips on how to use it to your advantage.