Create a Custom WordPress Welcome message in the Dashboard

This function creates a custom welcome message in the wordpress dashboard.

/**
 * Hide default welcome dashboard message and and create a custom one
 *
 * @access      public
 * @since       1.0 
 * @return      void
*/
function rc_my_welcome_panel() {

	?>
<script type="text/javascript">
/* Hide default welcome message */
jQuery(document).ready( function($) 
{
	$('div.welcome-panel-content').hide();
});
</script>

	<div class="custom-welcome-panel-content">
	<h3><?php _e( 'Welcome to Paddlr.' ); ?></h3>
	<p class="about-description"><?php _e( 'Paddlr is a place to record all the rivers you\'ve done and create detailed river trips. You can keep a log of what you\'ve done and view others and their travels.' ); ?></p>
	<div class="welcome-panel-column-container">
	<div class="welcome-panel-column">
	
	</div>
	<div class="welcome-panel-column">
		<h4><?php _e( 'Next Steps' ); ?></h4>
		<ul>
		<?php if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_for_posts' ) ) : ?>
		
			
		<?php else : ?>
        <li><?php printf( '<a href="%s" class="welcome-icon welcome-write-blog">' . __( 'Add a River Trip.' ) . '</a>', admin_url( 'post-new.php?post_type=rivers' ) ); ?></li>
			<li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add an About page' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
		<?php endif; ?>
			<li><?php printf( '<a href="%s" class="welcome-icon welcome-view-site">' . __( 'View your site' ) . '</a>', home_url( '/' ) ); ?></li>
		</ul>
	</div>
	
	</div>
	<!--<div class="">
	<h3><?php _e( 'If you need more space' ); ?></h3>
	<p class="about-description">Create a new paragraph!</p>
	<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Etiam porta sem malesuada magna mollis euismod.
	
	Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Etiam porta sem malesuada magna mollis euismod. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
	</div>-->
	</div>

<?php
}

add_action( 'welcome_panel', 'rc_my_welcome_panel' );

 

Leave a Reply

Your email address will not be published. Required fields are marked *

7 + = 11