Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function yapter_css_and_js(){
- wp_register_style('bootstrapcss',get_template_directory_uri().'/css/bootstrap.css');
- wp_register_style('bootstrapcss',get_template_directory_uri().'/css/animate.css');
- wp_register_style('animate',get_template_directory_uri().'/css/animate.css');
- wp_register_style('style',get_template_directory_uri().'/style.css');
- wp_register_script('jquery','//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js');
- wp_register_script('queryloader2',get_template_directory_uri().'/js/queryloader2.min.js');
- wp_register_script('wow',get_template_directory_uri().'/js/wow.min.js');
- wp_register_script('bootstrapjs',get_template_directory_uri().'/js/bootstrap.min.js');
- wp_register_script('slickjs',get_template_directory_uri().'/js/slick.min.js');
- wp_register_script('easing',get_template_directory_uri().'/js/jquery.easing.1.3.js');
- wp_register_script('animatejs',get_template_directory_uri().'/js/jquery.animate-enhanced.min.js');
- wp_register_script('superslidesjs',get_template_directory_uri().'/js/jquery.superslides.min.js');
- wp_register_script('circlifuljs','//cdn.rawgit.com/pguso/jquery-plugin-circliful/master/js/jquery.circliful.min.js');
- wp_register_script('tosrusjs',get_template_directory_uri().'/js/jquery.tosrus.min.all.js');
- wp_register_script('customjs',get_template_directory_uri().'/js/custom.js');
- wp_enqueue_style('bootstrapcss');
- wp_enqueue_style('fontawesome');
- wp_enqueue_style('superslides');
- wp_enqueue_style('circliful');
- wp_enqueue_style('slick');
- wp_enqueue_style('animate');
- wp_enqueue_style('tosrus');
- wp_enqueue_style('default-theme');
- wp_enqueue_style('style');
- wp_enqueue_script('jquery');
- wp_enqueue_script('queryloader2');
- wp_enqueue_script('wow');
- wp_enqueue_script('bootstrapjs');
- wp_enqueue_script('slickjs');
- wp_enqueue_script('easing');
- wp_enqueue_script('animatejs');
- wp_enqueue_script('superslidesjs');
- wp_enqueue_script('circlifuljs');
- wp_enqueue_script('tosrusjs');
- wp_enqueue_script('customjs');
- }
- add_action('wp_enqueue_scripts','yapter_css_and_js');
- add_action( 'init', 'codex_book_init' );
- function codex_book_init() {
- $labels = array(
- 'name' => _x( 'Slide', 'post type general name', 'your-plugin-textdomain' ),
- 'singular_name' => _x( 'Slide', 'post type singular name', 'your-plugin-textdomain' ),
- 'menu_name' => _x( 'Slide', 'admin menu', 'your-plugin-textdomain' ),
- 'name_admin_bar' => _x( 'Slide', 'add new on admin bar', 'your-plugin-textdomain' ),
- 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
- 'add_new_item' => __( 'Add New Slide', 'your-plugin-textdomain' ),
- 'new_item' => __( 'New Slide', 'your-plugin-textdomain' ),
- 'edit_item' => __( 'Edit Slide', 'your-plugin-textdomain' ),
- 'view_item' => __( 'View Slide', 'your-plugin-textdomain' ),
- 'all_items' => __( 'All Slide', 'your-plugin-textdomain' ),
- 'search_items' => __( 'Search Slide', 'your-plugin-textdomain' ),
- 'parent_item_colon' => __( 'Parent Slide:', 'your-plugin-textdomain' ),
- 'not_found' => __( 'No slide found.', 'your-plugin-textdomain' ),
- 'not_found_in_trash' => __( 'No slide found in Trash.', 'your-plugin-textdomain' )
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'slide' ),
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'hierarchical' => false,
- 'menu_position' => null,
- 'supports' => array( 'title')
- );
- register_post_type( 'slide', $args );
- }
- add_action( 'init', 'codex_testi_init' );
- function codex_testi_init() {
- $labels = array(
- 'name' => _x( 'Testimonials', 'post type general name', 'your-plugin-textdomain' ),
- 'singular_name' => _x( 'Testimonials', 'post type singular name', 'your-plugin-textdomain' ),
- 'menu_name' => _x( 'Testimonials', 'admin menu', 'your-plugin-textdomain' ),
- 'name_admin_bar' => _x( 'Testimonials', 'add new on admin bar', 'your-plugin-textdomain' ),
- 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
- 'add_new_item' => __( 'Add New Testimonials', 'your-plugin-textdomain' ),
- 'new_item' => __( 'New Testimonials', 'your-plugin-textdomain' ),
- 'edit_item' => __( 'Edit Testimonials', 'your-plugin-textdomain' ),
- 'view_item' => __( 'View Testimonials', 'your-plugin-textdomain' ),
- 'all_items' => __( 'All Testimonials', 'your-plugin-textdomain' ),
- 'search_items' => __( 'Search Testimonials', 'your-plugin-textdomain' ),
- 'parent_item_colon' => __( 'Parent Testimonials:', 'your-plugin-textdomain' ),
- 'not_found' => __( 'No testimonial found.', 'your-plugin-textdomain' ),
- 'not_found_in_trash' => __( 'No testimonial found in Trash.', 'your-plugin-textdomain' )
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'testimonial' ),
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'hierarchical' => false,
- 'menu_position' => null,
- 'supports' => array( 'title')
- );
- register_post_type( 'testimonial', $args );
- }
- add_action( 'init', 'codex_news_init' );
- function codex_news_init() {
- $labels = array(
- 'name' => _x( 'News', 'post type general name', 'your-plugin-textdomain' ),
- 'singular_name' => _x( 'News', 'post type singular name', 'your-plugin-textdomain' ),
- 'menu_name' => _x( 'News', 'admin menu', 'your-plugin-textdomain' ),
- 'name_admin_bar' => _x( 'News', 'add new on admin bar', 'your-plugin-textdomain' ),
- 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
- 'add_new_item' => __( 'Add New News', 'your-plugin-textdomain' ),
- 'new_item' => __( 'New News', 'your-plugin-textdomain' ),
- 'edit_item' => __( 'Edit News', 'your-plugin-textdomain' ),
- 'view_item' => __( 'View News', 'your-plugin-textdomain' ),
- 'all_items' => __( 'All News', 'your-plugin-textdomain' ),
- 'search_items' => __( 'Search News', 'your-plugin-textdomain' ),
- 'parent_item_colon' => __( 'Parent News:', 'your-plugin-textdomain' ),
- 'not_found' => __( 'No news found.', 'your-plugin-textdomain' ),
- 'not_found_in_trash' => __( 'No news found in Trash.', 'your-plugin-textdomain' )
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'news' ),
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'hierarchical' => false,
- 'menu_position' => null,
- 'supports' => array( 'title')
- );
- register_post_type( 'news', $args );
- }
- add_action( 'init', 'codex_blog_init' );
- function codex_blog_init() {
- $labels = array(
- 'name' => _x( 'Blog', 'post type general name', 'your-plugin-textdomain' ),
- 'singular_name' => _x( 'Blog', 'post type singular name', 'your-plugin-textdomain' ),
- 'menu_name' => _x( 'Blog', 'admin menu', 'your-plugin-textdomain' ),
- 'name_admin_bar' => _x( 'Blog', 'add new on admin bar', 'your-plugin-textdomain' ),
- 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
- 'add_new_item' => __( 'Add New Blog', 'your-plugin-textdomain' ),
- 'new_item' => __( 'New Blog', 'your-plugin-textdomain' ),
- 'edit_item' => __( 'Edit Blog', 'your-plugin-textdomain' ),
- 'view_item' => __( 'View Blog', 'your-plugin-textdomain' ),
- 'all_items' => __( 'All Blog', 'your-plugin-textdomain' ),
- 'search_items' => __( 'Search Blog', 'your-plugin-textdomain' ),
- 'parent_item_colon' => __( 'Parent Blog:', 'your-plugin-textdomain' ),
- 'not_found' => __( 'No blogs found.', 'your-plugin-textdomain' ),
- 'not_found_in_trash' => __( 'No blogs found in Trash.', 'your-plugin-textdomain' )
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'blog' ),
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'hierarchical' => false,
- 'menu_position' => null,
- 'supports' => array( 'title')
- );
- register_post_type( 'blog', $args );
- }
- add_action( 'init', 'codex_marina_init' );
- function codex_marina_init() {
- $labels = array(
- 'name' => _x( 'Marina', 'post type general name', 'your-plugin-textdomain' ),
- 'singular_name' => _x( 'Marina', 'post type singular name', 'your-plugin-textdomain' ),
- 'menu_name' => _x( 'Marina', 'admin menu', 'your-plugin-textdomain' ),
- 'name_admin_bar' => _x( 'Marina', 'add new on admin bar', 'your-plugin-textdomain' ),
- 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
- 'add_new_item' => __( 'Add New Marina', 'your-plugin-textdomain' ),
- 'new_item' => __( 'New Marina', 'your-plugin-textdomain' ),
- 'edit_item' => __( 'Edit Marina', 'your-plugin-textdomain' ),
- 'view_item' => __( 'View Marina', 'your-plugin-textdomain' ),
- 'all_items' => __( 'All Marina', 'your-plugin-textdomain' ),
- 'search_items' => __( 'Search Marina', 'your-plugin-textdomain' ),
- 'parent_item_colon' => __( 'Parent Marina:', 'your-plugin-textdomain' ),
- 'not_found' => __( 'No Marina found.', 'your-plugin-textdomain' ),
- 'not_found_in_trash' => __( 'No Marina found in Trash.', 'your-plugin-textdomain' )
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'Marina' ),
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'hierarchical' => false,
- 'menu_position' => null,
- 'supports' => array( 'title')
- );
- register_post_type( 'Marina', $args );
- }
- add_action( 'init', 'codex_mlc_init' );
- function codex_mlc_init() {
- $labels = array(
- 'name' => _x( 'MLC', 'post type general name', 'your-plugin-textdomain' ),
- 'singular_name' => _x( 'MLC', 'post type singular name', 'your-plugin-textdomain' ),
- 'menu_name' => _x( 'MLC', 'admin menu', 'your-plugin-textdomain' ),
- 'name_admin_bar' => _x( 'MLC', 'add new on admin bar', 'your-plugin-textdomain' ),
- 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
- 'add_new_item' => __( 'Add New MLC', 'your-plugin-textdomain' ),
- 'new_item' => __( 'New MLC', 'your-plugin-textdomain' ),
- 'edit_item' => __( 'Edit MLC', 'your-plugin-textdomain' ),
- 'view_item' => __( 'View MLC', 'your-plugin-textdomain' ),
- 'all_items' => __( 'All MLC', 'your-plugin-textdomain' ),
- 'search_items' => __( 'Search MLC', 'your-plugin-textdomain' ),
- 'parent_item_colon' => __( 'Parent MLC:', 'your-plugin-textdomain' ),
- 'not_found' => __( 'No MLC found.', 'your-plugin-textdomain' ),
- 'not_found_in_trash' => __( 'No MLC found in Trash.', 'your-plugin-textdomain' )
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'MLC' ),
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'hierarchical' => false,
- 'menu_position' => null,
- 'supports' => array( 'title')
- );
- register_post_type( 'MLC', $args );
- }
- add_action( 'init', 'codex_SOLAS_init' );
- function codex_SOLAS_init() {
- $labels = array(
- 'name' => _x( 'SOLAS', 'post type general name', 'your-plugin-textdomain' ),
- 'singular_name' => _x( 'SOLAS', 'post type singular name', 'your-plugin-textdomain' ),
- 'menu_name' => _x( 'SOLAS', 'admin menu', 'your-plugin-textdomain' ),
- 'name_admin_bar' => _x( 'SOLAS', 'add new on admin bar', 'your-plugin-textdomain' ),
- 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
- 'add_new_item' => __( 'Add New SOLAS', 'your-plugin-textdomain' ),
- 'new_item' => __( 'New SOLAS', 'your-plugin-textdomain' ),
- 'edit_item' => __( 'Edit SOLAS', 'your-plugin-textdomain' ),
- 'view_item' => __( 'View SOLAS', 'your-plugin-textdomain' ),
- 'all_items' => __( 'All SOLAS', 'your-plugin-textdomain' ),
- 'search_items' => __( 'Search SOLAS', 'your-plugin-textdomain' ),
- 'parent_item_colon' => __( 'Parent SOLAS:', 'your-plugin-textdomain' ),
- 'not_found' => __( 'No SOLAS found.', 'your-plugin-textdomain' ),
- 'not_found_in_trash' => __( 'No SOLAS found in Trash.', 'your-plugin-textdomain' )
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'SOLAS' ),
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'hierarchical' => false,
- 'menu_position' => null,
- 'supports' => array( 'title')
- );
- register_post_type( 'SOLAS', $args );
- }
- add_action( 'init', 'codex_ads_init' );
- function codex_ads_init() {
- $labels = array(
- 'name' => _x( 'ads', 'post type general name', 'your-plugin-textdomain' ),
- 'singular_name' => _x( 'ads', 'post type singular name', 'your-plugin-textdomain' ),
- 'menu_name' => _x( 'ads', 'admin menu', 'your-plugin-textdomain' ),
- 'name_admin_bar' => _x( 'ads', 'add new on admin bar', 'your-plugin-textdomain' ),
- 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
- 'add_new_item' => __( 'Add New ads', 'your-plugin-textdomain' ),
- 'new_item' => __( 'New ads', 'your-plugin-textdomain' ),
- 'edit_item' => __( 'Edit ads', 'your-plugin-textdomain' ),
- 'view_item' => __( 'View ads', 'your-plugin-textdomain' ),
- 'all_items' => __( 'All ads', 'your-plugin-textdomain' ),
- 'search_items' => __( 'Search ads', 'your-plugin-textdomain' ),
- 'parent_item_colon' => __( 'Parent ads:', 'your-plugin-textdomain' ),
- 'not_found' => __( 'No ads found.', 'your-plugin-textdomain' ),
- 'not_found_in_trash' => __( 'No ads found in Trash.', 'your-plugin-textdomain' )
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'ads' ),
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'hierarchical' => false,
- 'menu_position' => null,
- 'supports' => array( 'title')
- );
- register_post_type( 'ads', $args );
- }
- /*BOOTSTRAP MENU*/
- add_action( 'after_setup_theme', 'bootstrap_setup' );
- if ( ! function_exists( 'bootstrap_setup' ) ):
- function bootstrap_setup(){
- add_action( 'init', 'register_menu' );
- function register_menu(){
- register_nav_menu( 'top-bar', 'Bootstrap Top Menu' );
- }
- class Bootstrap_Walker_Nav_Menu extends Walker_Nav_Menu {
- function start_lvl( &$output, $depth ) {
- $indent = str_repeat( "\t", $depth );
- $output .= "\n$indent<ul class=\"dropdown-menu\">\n";
- }
- function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
- $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
- $li_attributes = '';
- $class_names = $value = '';
- $classes = empty( $item->classes ) ? array() : (array) $item->classes;
- $classes[] = ($args->has_children) ? 'dropdown' : '';
- $classes[] = ($item->current || $item->current_item_ancestor) ? 'active' : '';
- $classes[] = 'menu-item-' . $item->ID;
- $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
- $class_names = ' class="' . esc_attr( $class_names ) . '"';
- $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
- $id = strlen( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';
- $output .= $indent . '<li' . $id . $value . $class_names . $li_attributes . '>';
- $attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
- $attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
- $attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
- $attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
- $attributes .= ($args->has_children) ? ' class="dropdown-toggle" data-toggle="dropdown"' : '';
- $item_output = $args->before;
- $item_output .= '<a'. $attributes .'>';
- $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
- $item_output .= ($args->has_children) ? ' <b class="caret"></b></a>' : '</a>';
- $item_output .= $args->after;
- $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
- }
- function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {
- if ( !$element )
- return;
- $id_field = $this->db_fields['id'];
- //display this element
- if ( is_array( $args[0] ) )
- $args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] );
- else if ( is_object( $args[0] ) )
- $args[0]->has_children = ! empty( $children_elements[$element->$id_field] );
- $cb_args = array_merge( array(&$output, $element, $depth), $args);
- call_user_func_array(array(&$this, 'start_el'), $cb_args);
- $id = $element->$id_field;
- // descend only when the depth is right and there are childrens for this element
- if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) {
- foreach( $children_elements[ $id ] as $child ){
- if ( !isset($newlevel) ) {
- $newlevel = true;
- //start the child delimiter
- $cb_args = array_merge( array(&$output, $depth), $args);
- call_user_func_array(array(&$this, 'start_lvl'), $cb_args);
- }
- $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
- }
- unset( $children_elements[ $id ] );
- }
- if ( isset($newlevel) && $newlevel ){
- //end the child delimiter
- $cb_args = array_merge( array(&$output, $depth), $args);
- call_user_func_array(array(&$this, 'end_lvl'), $cb_args);
- }
- //end this element
- $cb_args = array_merge( array(&$output, $element, $depth), $args);
- call_user_func_array(array(&$this, 'end_el'), $cb_args);
- }
- }
- }
- endif;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement