File: /var/www/vhosts/enlugo.es/httpdocs/wp-content/themes/rubine/inc/theme-info.php
<?php
/***
* Theme Info
*
* Adds a simple Theme Info page to the Appearance section of the WordPress Dashboard.
*
*/
// Add Theme Info page to admin menu
add_action('admin_menu', 'rubine_add_theme_info_page');
function rubine_add_theme_info_page() {
add_theme_page(
__('Welcome to Rubine', 'rubine'),
__('Theme Info', 'rubine'),
'edit_theme_options',
'rubine',
'rubine_display_theme_info_page'
);
}
// Display Theme Info page
function rubine_display_theme_info_page() {
// Get Theme Details from style.css
$theme_data = wp_get_theme();
?>
<div class="wrap theme-info-wrap">
<h1><?php printf( __( 'Welcome to %1s %2s', 'rubine' ), $theme_data->Name, $theme_data->Version ); ?></h1>
<div class="theme-description"><?php echo $theme_data->Description; ?></div>
<hr>
<div class="important-links clearfix">
<p><strong><?php _e('Important Links:', 'rubine'); ?></strong>
<a href="http://themezee.com/themes/rubine/" target="_blank"><?php _e('Theme Info Page', 'rubine'); ?></a>
<a href="<?php echo get_template_directory_uri(); ?>/changelog.txt" target="_blank"><?php _e('Changelog', 'rubine'); ?></a>
<a href="http://preview.themezee.com/rubine/" target="_blank"><?php _e('Theme Demo', 'rubine'); ?></a>
<a href="http://themezee.com/docs/rubine-documentation/" target="_blank"><?php _e('Theme Documentation', 'rubine'); ?></a>
<span class="social-icons">
<a href="http://themezee.com/newsletter/" target="_blank"><span class="genericon-mail"></span></a>
<a href="https://www.facebook.com/ThemeZee" target="_blank"><span class="genericon-facebook"></span></a>
<a href="https://twitter.com/ThemeZee" target="_blank"><span class="genericon-twitter"></a>
</span>
</p>
</div>
<hr>
<div id="getting-started">
<div class="columns-wrapper clearfix">
<div class="column column-half clearfix">
<h3><?php printf( __( 'Getting Started with %s', 'rubine' ), $theme_data->Name ); ?></h3>
<div class="section">
<h4><?php _e( 'Theme Documentation', 'rubine' ); ?></h4>
<p class="about"><?php _e( 'Need any help to setup and configure this theme? We got you covered with an extensive theme documentation on our website.', 'rubine' ); ?></p>
<p>
<a href="http://themezee.com/docs/rubine-documentation/" target="_blank" class="button button-secondary"><?php _e('Visit Rubine Documentation', 'rubine'); ?></a>
</p>
</div>
<div class="section">
<h4><?php _e( 'Theme Options', 'rubine' ); ?></h4>
<p class="about"><?php _e( 'Rubine supports the awesome Theme Customizer for all theme settings. Click "Customize Theme" to open the Customizer now.', 'rubine' ); ?></p>
<p>
<a href="<?php echo admin_url( 'customize.php' ); ?>" class="button button-primary"><?php _e('Customize Theme', 'rubine'); ?></a>
</p>
</div>
</div>
<div class="column column-half clearfix">
<img src="<?php echo get_template_directory_uri(); ?>/screenshot.png" />
</div>
</div>
</div>
<hr>
<div id="theme-author">
<p><?php printf( __( 'Rubine is proudly brought to you by %1s.', 'rubine' ),
'<a target="_blank" href="http://themezee.com" title="ThemeZee">ThemeZee</a>'); ?>
</p>
</div>
</div>
<?php
}
// Add CSS for Theme Info Panel
add_action('admin_enqueue_scripts', 'rubine_theme_info_page_css');
function rubine_theme_info_page_css() {
// Load styles and scripts only on themezee page
if ( isset($_GET['page']) and $_GET['page'] == 'rubine' ) :
// Embed theme info css style
wp_enqueue_style('rubine-theme-info-css', get_template_directory_uri() .'/css/theme-info.css');
// Register Genericons
wp_enqueue_style('rubine-genericons', get_template_directory_uri() . '/css/genericons.css');
endif;
}
?>