Advertisement
Guest User

Untitled

a guest
May 30th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.14 KB | None | 0 0
  1. <?php
  2.  
  3. function yapter_css_and_js(){
  4. wp_register_style('bootstrapcss',get_template_directory_uri().'/css/bootstrap.css');
  5. wp_register_style('bootstrapcss',get_template_directory_uri().'/css/animate.css');
  6. wp_register_style('animate',get_template_directory_uri().'/css/animate.css');
  7. wp_register_style('style',get_template_directory_uri().'/style.css');
  8.  
  9. wp_register_script('jquery','//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js');
  10. wp_register_script('queryloader2',get_template_directory_uri().'/js/queryloader2.min.js');
  11. wp_register_script('wow',get_template_directory_uri().'/js/wow.min.js');
  12. wp_register_script('bootstrapjs',get_template_directory_uri().'/js/bootstrap.min.js');
  13. wp_register_script('slickjs',get_template_directory_uri().'/js/slick.min.js');
  14. wp_register_script('easing',get_template_directory_uri().'/js/jquery.easing.1.3.js');
  15. wp_register_script('animatejs',get_template_directory_uri().'/js/jquery.animate-enhanced.min.js');
  16. wp_register_script('superslidesjs',get_template_directory_uri().'/js/jquery.superslides.min.js');
  17. wp_register_script('circlifuljs','//cdn.rawgit.com/pguso/jquery-plugin-circliful/master/js/jquery.circliful.min.js');
  18. wp_register_script('tosrusjs',get_template_directory_uri().'/js/jquery.tosrus.min.all.js');
  19. wp_register_script('customjs',get_template_directory_uri().'/js/custom.js');
  20.  
  21. wp_enqueue_style('bootstrapcss');
  22. wp_enqueue_style('fontawesome');
  23. wp_enqueue_style('superslides');
  24. wp_enqueue_style('circliful');
  25. wp_enqueue_style('slick');
  26. wp_enqueue_style('animate');
  27. wp_enqueue_style('tosrus');
  28. wp_enqueue_style('default-theme');
  29. wp_enqueue_style('style');
  30.  
  31. wp_enqueue_script('jquery');
  32. wp_enqueue_script('queryloader2');
  33. wp_enqueue_script('wow');
  34. wp_enqueue_script('bootstrapjs');
  35. wp_enqueue_script('slickjs');
  36. wp_enqueue_script('easing');
  37. wp_enqueue_script('animatejs');
  38. wp_enqueue_script('superslidesjs');
  39. wp_enqueue_script('circlifuljs');
  40. wp_enqueue_script('tosrusjs');
  41. wp_enqueue_script('customjs');
  42. }
  43. add_action('wp_enqueue_scripts','yapter_css_and_js');
  44.  
  45. add_action( 'init', 'codex_book_init' );
  46. function codex_book_init() {
  47. $labels = array(
  48. 'name' => _x( 'Slide', 'post type general name', 'your-plugin-textdomain' ),
  49. 'singular_name' => _x( 'Slide', 'post type singular name', 'your-plugin-textdomain' ),
  50. 'menu_name' => _x( 'Slide', 'admin menu', 'your-plugin-textdomain' ),
  51. 'name_admin_bar' => _x( 'Slide', 'add new on admin bar', 'your-plugin-textdomain' ),
  52. 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
  53. 'add_new_item' => __( 'Add New Slide', 'your-plugin-textdomain' ),
  54. 'new_item' => __( 'New Slide', 'your-plugin-textdomain' ),
  55. 'edit_item' => __( 'Edit Slide', 'your-plugin-textdomain' ),
  56. 'view_item' => __( 'View Slide', 'your-plugin-textdomain' ),
  57. 'all_items' => __( 'All Slide', 'your-plugin-textdomain' ),
  58. 'search_items' => __( 'Search Slide', 'your-plugin-textdomain' ),
  59. 'parent_item_colon' => __( 'Parent Slide:', 'your-plugin-textdomain' ),
  60. 'not_found' => __( 'No slide found.', 'your-plugin-textdomain' ),
  61. 'not_found_in_trash' => __( 'No slide found in Trash.', 'your-plugin-textdomain' )
  62. );
  63.  
  64. $args = array(
  65. 'labels' => $labels,
  66. 'public' => true,
  67. 'publicly_queryable' => true,
  68. 'show_ui' => true,
  69. 'show_in_menu' => true,
  70. 'query_var' => true,
  71. 'rewrite' => array( 'slug' => 'slide' ),
  72. 'capability_type' => 'post',
  73. 'has_archive' => true,
  74. 'hierarchical' => false,
  75. 'menu_position' => null,
  76. 'supports' => array( 'title')
  77. );
  78.  
  79. register_post_type( 'slide', $args );
  80. }
  81.  
  82. add_action( 'init', 'codex_testi_init' );
  83. function codex_testi_init() {
  84. $labels = array(
  85. 'name' => _x( 'Testimonials', 'post type general name', 'your-plugin-textdomain' ),
  86. 'singular_name' => _x( 'Testimonials', 'post type singular name', 'your-plugin-textdomain' ),
  87. 'menu_name' => _x( 'Testimonials', 'admin menu', 'your-plugin-textdomain' ),
  88. 'name_admin_bar' => _x( 'Testimonials', 'add new on admin bar', 'your-plugin-textdomain' ),
  89. 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
  90. 'add_new_item' => __( 'Add New Testimonials', 'your-plugin-textdomain' ),
  91. 'new_item' => __( 'New Testimonials', 'your-plugin-textdomain' ),
  92. 'edit_item' => __( 'Edit Testimonials', 'your-plugin-textdomain' ),
  93. 'view_item' => __( 'View Testimonials', 'your-plugin-textdomain' ),
  94. 'all_items' => __( 'All Testimonials', 'your-plugin-textdomain' ),
  95. 'search_items' => __( 'Search Testimonials', 'your-plugin-textdomain' ),
  96. 'parent_item_colon' => __( 'Parent Testimonials:', 'your-plugin-textdomain' ),
  97. 'not_found' => __( 'No testimonial found.', 'your-plugin-textdomain' ),
  98. 'not_found_in_trash' => __( 'No testimonial found in Trash.', 'your-plugin-textdomain' )
  99. );
  100.  
  101. $args = array(
  102. 'labels' => $labels,
  103. 'public' => true,
  104. 'publicly_queryable' => true,
  105. 'show_ui' => true,
  106. 'show_in_menu' => true,
  107. 'query_var' => true,
  108. 'rewrite' => array( 'slug' => 'testimonial' ),
  109. 'capability_type' => 'post',
  110. 'has_archive' => true,
  111. 'hierarchical' => false,
  112. 'menu_position' => null,
  113. 'supports' => array( 'title')
  114. );
  115.  
  116. register_post_type( 'testimonial', $args );
  117. }
  118.  
  119. add_action( 'init', 'codex_news_init' );
  120. function codex_news_init() {
  121. $labels = array(
  122. 'name' => _x( 'News', 'post type general name', 'your-plugin-textdomain' ),
  123. 'singular_name' => _x( 'News', 'post type singular name', 'your-plugin-textdomain' ),
  124. 'menu_name' => _x( 'News', 'admin menu', 'your-plugin-textdomain' ),
  125. 'name_admin_bar' => _x( 'News', 'add new on admin bar', 'your-plugin-textdomain' ),
  126. 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
  127. 'add_new_item' => __( 'Add New News', 'your-plugin-textdomain' ),
  128. 'new_item' => __( 'New News', 'your-plugin-textdomain' ),
  129. 'edit_item' => __( 'Edit News', 'your-plugin-textdomain' ),
  130. 'view_item' => __( 'View News', 'your-plugin-textdomain' ),
  131. 'all_items' => __( 'All News', 'your-plugin-textdomain' ),
  132. 'search_items' => __( 'Search News', 'your-plugin-textdomain' ),
  133. 'parent_item_colon' => __( 'Parent News:', 'your-plugin-textdomain' ),
  134. 'not_found' => __( 'No news found.', 'your-plugin-textdomain' ),
  135. 'not_found_in_trash' => __( 'No news found in Trash.', 'your-plugin-textdomain' )
  136. );
  137.  
  138. $args = array(
  139. 'labels' => $labels,
  140. 'public' => true,
  141. 'publicly_queryable' => true,
  142. 'show_ui' => true,
  143. 'show_in_menu' => true,
  144. 'query_var' => true,
  145. 'rewrite' => array( 'slug' => 'news' ),
  146. 'capability_type' => 'post',
  147. 'has_archive' => true,
  148. 'hierarchical' => false,
  149. 'menu_position' => null,
  150. 'supports' => array( 'title')
  151. );
  152.  
  153. register_post_type( 'news', $args );
  154. }
  155.  
  156. add_action( 'init', 'codex_blog_init' );
  157. function codex_blog_init() {
  158. $labels = array(
  159. 'name' => _x( 'Blog', 'post type general name', 'your-plugin-textdomain' ),
  160. 'singular_name' => _x( 'Blog', 'post type singular name', 'your-plugin-textdomain' ),
  161. 'menu_name' => _x( 'Blog', 'admin menu', 'your-plugin-textdomain' ),
  162. 'name_admin_bar' => _x( 'Blog', 'add new on admin bar', 'your-plugin-textdomain' ),
  163. 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
  164. 'add_new_item' => __( 'Add New Blog', 'your-plugin-textdomain' ),
  165. 'new_item' => __( 'New Blog', 'your-plugin-textdomain' ),
  166. 'edit_item' => __( 'Edit Blog', 'your-plugin-textdomain' ),
  167. 'view_item' => __( 'View Blog', 'your-plugin-textdomain' ),
  168. 'all_items' => __( 'All Blog', 'your-plugin-textdomain' ),
  169. 'search_items' => __( 'Search Blog', 'your-plugin-textdomain' ),
  170. 'parent_item_colon' => __( 'Parent Blog:', 'your-plugin-textdomain' ),
  171. 'not_found' => __( 'No blogs found.', 'your-plugin-textdomain' ),
  172. 'not_found_in_trash' => __( 'No blogs found in Trash.', 'your-plugin-textdomain' )
  173. );
  174.  
  175. $args = array(
  176. 'labels' => $labels,
  177. 'public' => true,
  178. 'publicly_queryable' => true,
  179. 'show_ui' => true,
  180. 'show_in_menu' => true,
  181. 'query_var' => true,
  182. 'rewrite' => array( 'slug' => 'blog' ),
  183. 'capability_type' => 'post',
  184. 'has_archive' => true,
  185. 'hierarchical' => false,
  186. 'menu_position' => null,
  187. 'supports' => array( 'title')
  188. );
  189.  
  190. register_post_type( 'blog', $args );
  191. }
  192. add_action( 'init', 'codex_marina_init' );
  193. function codex_marina_init() {
  194. $labels = array(
  195. 'name' => _x( 'Marina', 'post type general name', 'your-plugin-textdomain' ),
  196. 'singular_name' => _x( 'Marina', 'post type singular name', 'your-plugin-textdomain' ),
  197. 'menu_name' => _x( 'Marina', 'admin menu', 'your-plugin-textdomain' ),
  198. 'name_admin_bar' => _x( 'Marina', 'add new on admin bar', 'your-plugin-textdomain' ),
  199. 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
  200. 'add_new_item' => __( 'Add New Marina', 'your-plugin-textdomain' ),
  201. 'new_item' => __( 'New Marina', 'your-plugin-textdomain' ),
  202. 'edit_item' => __( 'Edit Marina', 'your-plugin-textdomain' ),
  203. 'view_item' => __( 'View Marina', 'your-plugin-textdomain' ),
  204. 'all_items' => __( 'All Marina', 'your-plugin-textdomain' ),
  205. 'search_items' => __( 'Search Marina', 'your-plugin-textdomain' ),
  206. 'parent_item_colon' => __( 'Parent Marina:', 'your-plugin-textdomain' ),
  207. 'not_found' => __( 'No Marina found.', 'your-plugin-textdomain' ),
  208. 'not_found_in_trash' => __( 'No Marina found in Trash.', 'your-plugin-textdomain' )
  209. );
  210.  
  211. $args = array(
  212. 'labels' => $labels,
  213. 'public' => true,
  214. 'publicly_queryable' => true,
  215. 'show_ui' => true,
  216. 'show_in_menu' => true,
  217. 'query_var' => true,
  218. 'rewrite' => array( 'slug' => 'Marina' ),
  219. 'capability_type' => 'post',
  220. 'has_archive' => true,
  221. 'hierarchical' => false,
  222. 'menu_position' => null,
  223. 'supports' => array( 'title')
  224. );
  225.  
  226. register_post_type( 'Marina', $args );
  227. }
  228. add_action( 'init', 'codex_mlc_init' );
  229. function codex_mlc_init() {
  230. $labels = array(
  231. 'name' => _x( 'MLC', 'post type general name', 'your-plugin-textdomain' ),
  232. 'singular_name' => _x( 'MLC', 'post type singular name', 'your-plugin-textdomain' ),
  233. 'menu_name' => _x( 'MLC', 'admin menu', 'your-plugin-textdomain' ),
  234. 'name_admin_bar' => _x( 'MLC', 'add new on admin bar', 'your-plugin-textdomain' ),
  235. 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
  236. 'add_new_item' => __( 'Add New MLC', 'your-plugin-textdomain' ),
  237. 'new_item' => __( 'New MLC', 'your-plugin-textdomain' ),
  238. 'edit_item' => __( 'Edit MLC', 'your-plugin-textdomain' ),
  239. 'view_item' => __( 'View MLC', 'your-plugin-textdomain' ),
  240. 'all_items' => __( 'All MLC', 'your-plugin-textdomain' ),
  241. 'search_items' => __( 'Search MLC', 'your-plugin-textdomain' ),
  242. 'parent_item_colon' => __( 'Parent MLC:', 'your-plugin-textdomain' ),
  243. 'not_found' => __( 'No MLC found.', 'your-plugin-textdomain' ),
  244. 'not_found_in_trash' => __( 'No MLC found in Trash.', 'your-plugin-textdomain' )
  245. );
  246.  
  247. $args = array(
  248. 'labels' => $labels,
  249. 'public' => true,
  250. 'publicly_queryable' => true,
  251. 'show_ui' => true,
  252. 'show_in_menu' => true,
  253. 'query_var' => true,
  254. 'rewrite' => array( 'slug' => 'MLC' ),
  255. 'capability_type' => 'post',
  256. 'has_archive' => true,
  257. 'hierarchical' => false,
  258. 'menu_position' => null,
  259. 'supports' => array( 'title')
  260. );
  261.  
  262. register_post_type( 'MLC', $args );
  263. }
  264. add_action( 'init', 'codex_SOLAS_init' );
  265. function codex_SOLAS_init() {
  266. $labels = array(
  267. 'name' => _x( 'SOLAS', 'post type general name', 'your-plugin-textdomain' ),
  268. 'singular_name' => _x( 'SOLAS', 'post type singular name', 'your-plugin-textdomain' ),
  269. 'menu_name' => _x( 'SOLAS', 'admin menu', 'your-plugin-textdomain' ),
  270. 'name_admin_bar' => _x( 'SOLAS', 'add new on admin bar', 'your-plugin-textdomain' ),
  271. 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
  272. 'add_new_item' => __( 'Add New SOLAS', 'your-plugin-textdomain' ),
  273. 'new_item' => __( 'New SOLAS', 'your-plugin-textdomain' ),
  274. 'edit_item' => __( 'Edit SOLAS', 'your-plugin-textdomain' ),
  275. 'view_item' => __( 'View SOLAS', 'your-plugin-textdomain' ),
  276. 'all_items' => __( 'All SOLAS', 'your-plugin-textdomain' ),
  277. 'search_items' => __( 'Search SOLAS', 'your-plugin-textdomain' ),
  278. 'parent_item_colon' => __( 'Parent SOLAS:', 'your-plugin-textdomain' ),
  279. 'not_found' => __( 'No SOLAS found.', 'your-plugin-textdomain' ),
  280. 'not_found_in_trash' => __( 'No SOLAS found in Trash.', 'your-plugin-textdomain' )
  281. );
  282.  
  283. $args = array(
  284. 'labels' => $labels,
  285. 'public' => true,
  286. 'publicly_queryable' => true,
  287. 'show_ui' => true,
  288. 'show_in_menu' => true,
  289. 'query_var' => true,
  290. 'rewrite' => array( 'slug' => 'SOLAS' ),
  291. 'capability_type' => 'post',
  292. 'has_archive' => true,
  293. 'hierarchical' => false,
  294. 'menu_position' => null,
  295. 'supports' => array( 'title')
  296. );
  297.  
  298. register_post_type( 'SOLAS', $args );
  299. }
  300. add_action( 'init', 'codex_ads_init' );
  301. function codex_ads_init() {
  302. $labels = array(
  303. 'name' => _x( 'ads', 'post type general name', 'your-plugin-textdomain' ),
  304. 'singular_name' => _x( 'ads', 'post type singular name', 'your-plugin-textdomain' ),
  305. 'menu_name' => _x( 'ads', 'admin menu', 'your-plugin-textdomain' ),
  306. 'name_admin_bar' => _x( 'ads', 'add new on admin bar', 'your-plugin-textdomain' ),
  307. 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
  308. 'add_new_item' => __( 'Add New ads', 'your-plugin-textdomain' ),
  309. 'new_item' => __( 'New ads', 'your-plugin-textdomain' ),
  310. 'edit_item' => __( 'Edit ads', 'your-plugin-textdomain' ),
  311. 'view_item' => __( 'View ads', 'your-plugin-textdomain' ),
  312. 'all_items' => __( 'All ads', 'your-plugin-textdomain' ),
  313. 'search_items' => __( 'Search ads', 'your-plugin-textdomain' ),
  314. 'parent_item_colon' => __( 'Parent ads:', 'your-plugin-textdomain' ),
  315. 'not_found' => __( 'No ads found.', 'your-plugin-textdomain' ),
  316. 'not_found_in_trash' => __( 'No ads found in Trash.', 'your-plugin-textdomain' )
  317. );
  318.  
  319. $args = array(
  320. 'labels' => $labels,
  321. 'public' => true,
  322. 'publicly_queryable' => true,
  323. 'show_ui' => true,
  324. 'show_in_menu' => true,
  325. 'query_var' => true,
  326. 'rewrite' => array( 'slug' => 'ads' ),
  327. 'capability_type' => 'post',
  328. 'has_archive' => true,
  329. 'hierarchical' => false,
  330. 'menu_position' => null,
  331. 'supports' => array( 'title')
  332. );
  333.  
  334. register_post_type( 'ads', $args );
  335. }
  336. /*BOOTSTRAP MENU*/
  337. add_action( 'after_setup_theme', 'bootstrap_setup' );
  338.  
  339. if ( ! function_exists( 'bootstrap_setup' ) ):
  340.  
  341. function bootstrap_setup(){
  342.  
  343. add_action( 'init', 'register_menu' );
  344.  
  345. function register_menu(){
  346. register_nav_menu( 'top-bar', 'Bootstrap Top Menu' );
  347. }
  348.  
  349. class Bootstrap_Walker_Nav_Menu extends Walker_Nav_Menu {
  350.  
  351.  
  352. function start_lvl( &$output, $depth ) {
  353.  
  354. $indent = str_repeat( "\t", $depth );
  355. $output .= "\n$indent<ul class=\"dropdown-menu\">\n";
  356.  
  357. }
  358.  
  359. function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
  360.  
  361. $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
  362.  
  363. $li_attributes = '';
  364. $class_names = $value = '';
  365.  
  366. $classes = empty( $item->classes ) ? array() : (array) $item->classes;
  367. $classes[] = ($args->has_children) ? 'dropdown' : '';
  368. $classes[] = ($item->current || $item->current_item_ancestor) ? 'active' : '';
  369. $classes[] = 'menu-item-' . $item->ID;
  370.  
  371.  
  372. $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
  373. $class_names = ' class="' . esc_attr( $class_names ) . '"';
  374.  
  375. $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
  376. $id = strlen( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';
  377.  
  378. $output .= $indent . '<li' . $id . $value . $class_names . $li_attributes . '>';
  379.  
  380. $attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
  381. $attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
  382. $attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
  383. $attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
  384. $attributes .= ($args->has_children) ? ' class="dropdown-toggle" data-toggle="dropdown"' : '';
  385.  
  386. $item_output = $args->before;
  387. $item_output .= '<a'. $attributes .'>';
  388. $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
  389. $item_output .= ($args->has_children) ? ' <b class="caret"></b></a>' : '</a>';
  390. $item_output .= $args->after;
  391.  
  392. $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
  393. }
  394.  
  395. function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {
  396.  
  397. if ( !$element )
  398. return;
  399.  
  400. $id_field = $this->db_fields['id'];
  401.  
  402. //display this element
  403. if ( is_array( $args[0] ) )
  404. $args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] );
  405. else if ( is_object( $args[0] ) )
  406. $args[0]->has_children = ! empty( $children_elements[$element->$id_field] );
  407. $cb_args = array_merge( array(&$output, $element, $depth), $args);
  408. call_user_func_array(array(&$this, 'start_el'), $cb_args);
  409.  
  410. $id = $element->$id_field;
  411.  
  412. // descend only when the depth is right and there are childrens for this element
  413. if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) {
  414.  
  415. foreach( $children_elements[ $id ] as $child ){
  416.  
  417. if ( !isset($newlevel) ) {
  418. $newlevel = true;
  419. //start the child delimiter
  420. $cb_args = array_merge( array(&$output, $depth), $args);
  421. call_user_func_array(array(&$this, 'start_lvl'), $cb_args);
  422. }
  423. $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
  424. }
  425. unset( $children_elements[ $id ] );
  426. }
  427.  
  428. if ( isset($newlevel) && $newlevel ){
  429. //end the child delimiter
  430. $cb_args = array_merge( array(&$output, $depth), $args);
  431. call_user_func_array(array(&$this, 'end_lvl'), $cb_args);
  432. }
  433.  
  434. //end this element
  435. $cb_args = array_merge( array(&$output, $element, $depth), $args);
  436. call_user_func_array(array(&$this, 'end_el'), $cb_args);
  437.  
  438. }
  439.  
  440. }
  441.  
  442. }
  443.  
  444. endif;
  445. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement