Advertisement
fgleite

functions.php

May 4th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. <?php
  2.  
  3. add_theme_support( 'post-thumbnails' );
  4.  
  5.  
  6.  
  7. if (!current_user_can('manage_options')) {
  8. add_filter('show_admin_bar', '__return_false');
  9. }
  10.  
  11. function excerpt_read_more_link($output) {
  12. global $post;
  13. }
  14. function custom_excerpt_length( $length )
  15. {
  16. return 25;
  17. }
  18. add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
  19.  
  20.  
  21. function sem_paginas_na_busca($query) {
  22. if ($query->is_search) {
  23. $query->set('post_type', 'post');
  24. };
  25. return $query;
  26. };
  27. add_filter('pre_get_posts', 'sem_paginas_na_busca');
  28.  
  29.  
  30.  
  31.  
  32. /**
  33. * Load javascripts used by the theme
  34. */
  35. function custom_theme_js(){
  36. wp_register_script( 'infinite_scroll', get_template_directory_uri() . '/js/jquery.infinitescroll.min.js', array('jquery'),null,true );
  37. if( ! is_singular() ) {
  38. wp_enqueue_script('infinite_scroll');
  39. }
  40. }
  41. add_action('wp_enqueue_scripts', 'custom_theme_js');
  42.  
  43.  
  44.  
  45. // REMOVE THE WORDPRESS UPDATE NOTIFICATION FOR ALL USERS EXCEPT SYSADMIN
  46. global $user_login;
  47. get_currentuserinfo();
  48. if (!current_user_can('update_plugins')) { // checks to see if current user can update plugins
  49. add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 );
  50. add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) );
  51. }
  52.  
  53. // customize admin footer text
  54. function custom_admin_footer() {
  55. echo 'Capella Design';
  56. }
  57. add_filter('admin_footer_text', 'custom_admin_footer');
  58.  
  59.  
  60.  
  61. function create_post_type() {
  62.  
  63. register_post_type( 'Banner Inicial',
  64. array(
  65. 'labels' => array(
  66. 'name' => __( 'Banner Inicial' ),
  67. 'singular_name' => __( 'Banner Inicial' )
  68. ),
  69. 'public' => true,
  70. 'menu_position' => 54,
  71. 'supports' => array('title','editor','thumbnail'),
  72. 'rewrite' => array('slug' => 'banner-inicial')
  73. )
  74. );
  75.  
  76. /* register_post_type( 'eventos',
  77. array(
  78. 'labels' => array(
  79. 'name' => __( 'Eventos' ),
  80. 'singular_name' => __( 'Evento' )
  81. ),
  82. 'public' => true,
  83. 'menu_position' => 54,
  84. 'supports' => array('title','editor','thumbnail'),
  85. 'rewrite' => array('slug' => 'eventos')
  86. )
  87. );
  88.  
  89. register_post_type( 'evento-destaque',
  90. array(
  91. 'labels' => array(
  92. 'name' => __( 'Evento em Destaque' ),
  93. 'singular_name' => __( 'Evento' )
  94. ),
  95. 'public' => true,
  96. 'menu_position' => 54,
  97. 'supports' => array('title','editor','thumbnail'),
  98. 'rewrite' => array('slug' => 'evento-destaque')
  99. )
  100. );
  101. */
  102. register_post_type( 'banner-maior',
  103. array(
  104. 'labels' => array(
  105. 'name' => __( 'Banner maior' ),
  106. 'singular_name' => __( 'Banner' )
  107. ),
  108. 'public' => true,
  109. 'menu_position' => 54,
  110. 'supports' => array('title','editor','thumbnail'),
  111. 'rewrite' => array('slug' => 'banner-maior')
  112. )
  113. );
  114.  
  115.  
  116. register_post_type( 'banner-menor',
  117. array(
  118. 'labels' => array(
  119. 'name' => __( 'Banner menor' ),
  120. 'singular_name' => __( 'Banner' )
  121. ),
  122. 'public' => true,
  123. 'menu_position' => 54,
  124. 'supports' => array('title','editor','thumbnail'),
  125. 'rewrite' => array('slug' => 'banner-menor')
  126. )
  127. );
  128.  
  129. }
  130.  
  131. add_action( 'init', 'create_post_type' );
  132.  
  133. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement