WordPress condition if … else statement for wp_pagenavi plugin

I wanted to create a condition in a theme, where if the plugin wp_pagenavi existed then use the plugin. If the plugin does not exist, then use the text Next and Previous.  Researching through the internet took quite some time and without a functioning code.  I found this code in another WordPress theme and applied it to another and it worked great.  The code below was applied to the footer.php file and any existing remnant of the original code was removed from the index.php page.

<div class="post_nav">
<?php
if(function_exists('wp_pagenavi')):	wp_pagenavi();
else : posts_nav_link();
endif;
?>
</div>

I also appended the following to the style.css. It wasn’t really necessary to get the code operational, but did make things a little smoother.  This code was also taken from a theme or two.

.post_nav {
float: left;
width: 620px;
padding-left: 10px;
}

.post_nav a:link, .post_nav a:visited {
color: #006699;
text-decoration: none;
}

.post_nav a:hover, .post_nav a:active {
color: #006699;
text-decoration: underline;