evolve_after_setup

Theme Setup Functions.

Description

evolve_after_setup(); 

Usage

  1. if ( !function_exists( 'evolve_after_setup' ) ) { 
  2. require_once '/library/functions/basic-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = evolve_after_setup(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/library/functions/basic-functions.php  
  1. function evolve_after_setup() { 
  2.  
  3. add_theme_support('automatic-feed-links'); 
  4. add_theme_support('post-thumbnails'); 
  5. add_theme_support('title-tag'); 
  6. add_image_size('post-thumbnail', 680, 330, true); 
  7. add_image_size('slider-thumbnail', 400, 280, true); 
  8. add_image_size('tabs-img', 50, 50, true); 
  9. add_editor_style('editor-style.css'); 
  10.  
  11. if (version_compare($GLOBALS['wp_version'], '4.1', '<')) : 
  12.  
  13. /** 
  14. * Filters wp_title to print a neat <title> tag based on what is being viewed. 
  15. * @param string $title Default title text for current view. 
  16. * @param string $sep Optional separator. 
  17. * @return string The filtered title. 
  18. */ 
  19. function evolve_wp_title($title, $sep) { 
  20. if (is_feed()) { 
  21. return $title; 
  22. global $page, $paged; 
  23.  
  24. // Add the blog name 
  25. $title .= get_bloginfo('name', 'display'); 
  26.  
  27. // Add the blog description for the home/front page. 
  28. $site_description = get_bloginfo('description', 'display'); 
  29. if ($site_description && ( is_home() || is_front_page() )) { 
  30. $title .= " $sep $site_description"; 
  31.  
  32. // Add a page number if necessary: 
  33. if (( $paged >= 2 || $page >= 2 ) && !is_404()) { 
  34. $title .= " $sep " . sprintf(__('Page %s', 'evolve'), max($paged, $page)); 
  35.  
  36. return $title; 
  37.  
  38. add_filter('wp_title', 'evolve_wp_title', 10, 2); 
  39.  
  40. /** 
  41. * Title shim for sites older than WordPress 4.1. 
  42. * @link https://make.wordpress.org/core/2014/10/29/title-tags-in-4-1/ 
  43. * @todo Remove this function when WordPress 4.3 is released. 
  44. */ 
  45. function evolve_render_title() { 
  46. ?> 
  47. <title><?php wp_title('-', true, 'right'); ?></title> 
  48. <?php 
  49.  
  50. add_action('wp_head', 'evolve_render_title'); 
  51. endif; 
  52.  
  53. $evolve_width_px = evolve_get_option('evl_width_px', '1200'); 
  54. $evolve_width_px = apply_filters('evolve_header_image_width', $evolve_width_px); 
  55. //define( 'HEADER_IMAGE_WIDTH', apply_filters( 'evolve_header_image_width', $evolve_width_px ) ); 
  56. //define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'evolve_header_image_height', 170 ) ); 
  57. //define( 'HEADER_TEXTCOLOR', '' ); 
  58. //define( 'NO_HEADER_TEXT', true ); 
  59. //mod by denzel, allow flexible width and flexible height. 
  60. $args = array( 
  61. 'flex-width' => true,  
  62. 'width' => $evolve_width_px,  
  63. 'flex-height' => true,  
  64. 'height' => 200,  
  65. 'header-text' => false,  
  66. ); 
  67. add_theme_support('custom-header', $args); 
  68.  
  69.  
  70. $evolve_width_layout = evolve_get_option('evl_width_layout', 'fixed'); 
  71.  
  72. if ($evolve_width_layout == "fixed") { 
  73. $defaults = array( 
  74. 'default-color' => 'e5e5e5',  
  75. 'default-image' => '' 
  76. ); 
  77. add_theme_support('custom-background', $defaults); 
  78.  
  79. add_theme_support('post-formats', array( 
  80. 'aside',  
  81. 'audio',  
  82. 'chat',  
  83. 'gallery',  
  84. 'image',  
  85. 'link',  
  86. 'quote',  
  87. 'status',  
  88. 'video' 
  89. )); 
  90.  
  91. load_theme_textdomain('evolve', get_template_directory() . '/languages'); 
  92.  
  93. register_nav_menu('primary-menu', __('Primary Menu', 'evolve')); 
  94.  
  95. $evolve_layout = evolve_get_option('evl_layout', '2cr'); 
  96. $evolve_width_layout = evolve_get_option('evl_width_layout', 'fixed'); 
  97.  
  98. global $content_width; 
  99.  
  100. if ($evolve_layout == "2cl" || $evolve_layout == "2cr") { 
  101. if (!isset($content_width)) { 
  102. $content_width = 610; 
  103. if (( $evolve_layout == "3cl" || $evolve_layout == "3cr" ) || 
  104. ( $evolve_layout == "3cm" ) 
  105. ) { 
  106. if (!isset($content_width)) { 
  107. $content_width = 506; 
  108. if ($evolve_layout == "1c") { 
  109. if (!isset($content_width)) { 
  110. $content_width = 955;