Permalink
Browse files

remove redundant session_start()

  • Loading branch information...
marpa committed Jan 18, 2015
1 parent cbd1d0e commit dd05c5c09be5c6537ace2711a7d0778e25c95317
Showing with 34 additions and 14 deletions.
  1. +33 −13 functions.php
  2. +1 −1 header.php
View
@@ -97,6 +97,11 @@ function translucence_add_config()
require_once( get_template_directory() . '/template-options.php');
require_once( get_template_directory() . '/options-css.php');
/** Tell WordPress to run translucence_enqueue_scripts() when the 'wp_enqueue_scripts' hook is run. */
add_action( 'wp_enqueue_scripts', 'translucence_enqueue_scripts' );
/** Tell WordPress to run translucence_admin_enqueue_scripts() when the 'admin_enqueue_scripts' hook is run. */
add_action( 'admin_enqueue_scripts', 'translucence_admin_enqueue_scripts' );
/** Tell WordPress to run translucence_setup() when the 'after_setup_theme' hook is run. */
add_action( 'after_setup_theme', 'translucence_setup' );
@@ -105,6 +110,21 @@ function translucence_add_config()
add_action('wp_head', 'translucence_add_options_css');
function translucence_admin_enqueue_scripts() {
// add conditional to check for admin pages
wp_register_script('admin.control', get_template_directory_uri(). '/js/admin.control.js');
wp_enqueue_script('admin.control');
}
function translucence_enqueue_scripts() {
wp_enqueue_script('jquery');
wp_register_script('display.control', get_template_directory_uri() . '/js/display.control.js');
wp_enqueue_script('display.control');
wp_register_script('jquery.inline_label', get_template_directory_uri() . '/js/jquery.inline_label.js');
wp_enqueue_script('jquery.inline_label');
}
if ( ! function_exists( 'translucence_setup' ) ):
/**
* Sets up theme defaults and registers support for various WordPress features.
@@ -143,19 +163,19 @@ function translucence_setup() {
*********************************************************/
// front end javascript
if ( !is_admin() ) {
wp_enqueue_script('jquery');
}
if ( !is_admin() ) {
wp_register_script('display.control', get_template_directory_uri() . '/js/display.control.js');
wp_enqueue_script('display.control');
wp_register_script('jquery.inline_label', get_template_directory_uri() . '/js/jquery.inline_label.js');
wp_enqueue_script('jquery.inline_label');
} else {
wp_register_script('admin.control', get_template_directory_uri(). '/js/admin.control.js');
wp_enqueue_script('admin.control');
}
// if ( !is_admin() ) {
// wp_enqueue_script('jquery');
// }
//
// if ( !is_admin() ) {
// wp_register_script('display.control', get_template_directory_uri() . '/js/display.control.js');
// wp_enqueue_script('display.control');
// wp_register_script('jquery.inline_label', get_template_directory_uri() . '/js/jquery.inline_label.js');
// wp_enqueue_script('jquery.inline_label');
// } else {
// wp_register_script('admin.control', get_template_directory_uri(). '/js/admin.control.js');
// wp_enqueue_script('admin.control');
// }
// include theme options
require_once ( get_template_directory() . '/functions/theme-options.php' );
View
@@ -10,7 +10,7 @@
*/
// Starting the session
session_start();
//session_start();
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>

0 comments on commit dd05c5c

Please sign in to comment.