Advertisement
Guest User

Untitled

a guest
Jan 1st, 2015
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  
  5. *
  6.  
  7. * This program is a free software; you can use it and/or modify it under the terms of the GNU
  8.  
  9. * General Public License as published by the Free Software Foundation; either version 2 of the License,
  10.  
  11. * or (at your option) any later version.
  12.  
  13. *
  14.  
  15. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  16.  
  17. * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18.  
  19. *
  20.  
  21. * You should have received a copy of the GNU General Public License along with this program; if not, write
  22.  
  23. * to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  24.  
  25. *
  26.  
  27. * @package Customizr
  28.  
  29. * @subpackage functions
  30.  
  31. * @since 1.0
  32.  
  33. * @author Nicolas GUILLAUME <nicolas@themesandco.com>
  34.  
  35. * @copyright Copyright (c) 2013, Nicolas GUILLAUME
  36.  
  37. * @link http://themesandco.com/customizr
  38.  
  39. * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  40.  
  41. */
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49. /**
  50.  
  51. * This is where Customizr starts. This file defines and loads the theme's components :
  52.  
  53. * 1) A function tc__f() used everywhere in the theme, extension of WP built-in apply_filters()
  54.  
  55. * 2) Constants : CUSTOMIZR_VER, TC_BASE, TC_BASE_CHILD, TC_BASE_URL, TC_BASE_URL_CHILD, THEMENAME, TC_WEBSITE
  56.  
  57. * 3) Default filtered values : images sizes, skins, featured pages, social networks, widgets, post list layout
  58.  
  59. * 4) Text Domain
  60.  
  61. * 5) Theme supports : editor style, automatic-feed-links, post formats, navigation menu, post-thumbnails, retina support
  62.  
  63. * 6) Plugins compatibility : jetpack, bbpress, qtranslate, woocommerce and more to come
  64.  
  65. * 7) Default filtered options for the customizer
  66.  
  67. * 8) Customizr theme's hooks API : front end components are rendered with action and filter hooks
  68.  
  69. *
  70.  
  71. * The method TC__::tc__() loads the php files and instanciates all theme's classes.
  72.  
  73. * All classes files (except the class__.php file which loads the other) are named with the following convention : class-[group]-[class_name].php
  74.  
  75. *
  76.  
  77. * The theme is entirely built on an extensible filter and action hooks API, which makes customizations easy as breeze, without ever needing to modify the core structure.
  78.  
  79. * Customizr's code acts like a collection of plugins that can be enabled, disabled or extended. More here : http://themesandco.com/customizr/hooks-api
  80.  
  81. *
  82.  
  83. */
  84.  
  85.  
  86.  
  87.  
  88.  
  89. //Fire Customizr
  90.  
  91. require_once( get_template_directory() . '/inc/init.php' );
  92.  
  93.  
  94.  
  95. /**
  96.  
  97. * The best and safest way to extend Customizr with your own custom functions is to create a child theme.
  98.  
  99. * You can add functions here but they will be lost on upgrade. If you use a child theme, you are safe!
  100.  
  101. * More informations on how to create a child theme with Customizr here : http://themesandco.com/customizr/#child-theme
  102.  
  103. */
  104.  
  105. add_action('wp_head' , 'link_whole_slide');
  106. function link_whole_slide() {
  107. //sets the slider image link
  108. add_filter('tc_slide_background' , 'my_slide_link', 10, 3);
  109. function my_slide_link( $slide_image , $slide_link, $attachment_id) {
  110. //sets the slider image link
  111. return sprintf('<a href="%1$s" title="%2$s">%3$s</a>',
  112. $slide_link,
  113. get_the_title($attachment_id), //will use the title of the picture on mouse hovering
  114. $slide_image
  115. );
  116. }
  117. //wraps the slider caption in the same link as the call to action button
  118. ?>
  119. <script type="text/javascript">
  120. jQuery(document).ready(function () {
  121. ! function ($) {
  122. //prevents js conflicts
  123. "use strict";
  124. $( '.carousel-caption' ).each(function( index ) {
  125. var link = $( this ).parent().find('a').attr('href');
  126. $(this).wrap('<a href="'+link+'"></a>');
  127. });
  128. }(window.jQuery)
  129. });
  130. </script>
  131. <?php
  132. }
  133. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement