How to Add Rotating Banner in WordPress?

Adding a rotating banner in WordPress is easy. First, add the following code to your theme’s functions.php file:

function rotate_banner() { wp_banner(‘rotating’, ‘left’, ‘bottom’, ‘right’); } add_action(‘wp_banner’, ‘rotate_banner’);

Next, create a file called rotating.php and add the following code:

Finally, create a file called index.php and add the following code:

setImage(‘images/banner.jpg’); $banner->setText(‘Rotating Banner!’); $banner->setPosition(‘right’); $banner->setSize(300, 250); $banner->show(); ?>.

If you’d like to disable the banner, simply remove the show() call from the index.php file.