Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * This program is a free software; you can use it and/or modify it under the terms of the GNU
- * General Public License as published by the Free Software Foundation; either version 2 of the License,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along with this program; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @package Customizr
- * @subpackage functions
- * @since 1.0
- * @author Nicolas GUILLAUME <nicolas@themesandco.com>
- * @copyright Copyright (c) 2013, Nicolas GUILLAUME
- * @link http://themesandco.com/customizr
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
- */
- /**
- * This is where Customizr starts. This file defines and loads the theme's components :
- * 1) A function tc__f() used everywhere in the theme, extension of WP built-in apply_filters()
- * 2) Constants : CUSTOMIZR_VER, TC_BASE, TC_BASE_CHILD, TC_BASE_URL, TC_BASE_URL_CHILD, THEMENAME, TC_WEBSITE
- * 3) Default filtered values : images sizes, skins, featured pages, social networks, widgets, post list layout
- * 4) Text Domain
- * 5) Theme supports : editor style, automatic-feed-links, post formats, navigation menu, post-thumbnails, retina support
- * 6) Plugins compatibility : jetpack, bbpress, qtranslate, woocommerce and more to come
- * 7) Default filtered options for the customizer
- * 8) Customizr theme's hooks API : front end components are rendered with action and filter hooks
- *
- * The method TC__::tc__() loads the php files and instanciates all theme's classes.
- * All classes files (except the class__.php file which loads the other) are named with the following convention : class-[group]-[class_name].php
- *
- * 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.
- * Customizr's code acts like a collection of plugins that can be enabled, disabled or extended. More here : http://themesandco.com/customizr/hooks-api
- *
- */
- //Fire Customizr
- require_once( get_template_directory() . '/inc/init.php' );
- /**
- * The best and safest way to extend Customizr with your own custom functions is to create a child theme.
- * You can add functions here but they will be lost on upgrade. If you use a child theme, you are safe!
- * More informations on how to create a child theme with Customizr here : http://themesandco.com/customizr/#child-theme
- */
- add_action('wp_head' , 'link_whole_slide');
- function link_whole_slide() {
- //sets the slider image link
- add_filter('tc_slide_background' , 'my_slide_link', 10, 3);
- function my_slide_link( $slide_image , $slide_link, $attachment_id) {
- //sets the slider image link
- return sprintf('<a href="%1$s" title="%2$s">%3$s</a>',
- $slide_link,
- get_the_title($attachment_id), //will use the title of the picture on mouse hovering
- $slide_image
- );
- }
- //wraps the slider caption in the same link as the call to action button
- ?>
- <script type="text/javascript">
- jQuery(document).ready(function () {
- ! function ($) {
- //prevents js conflicts
- "use strict";
- $( '.carousel-caption' ).each(function( index ) {
- var link = $( this ).parent().find('a').attr('href');
- $(this).wrap('<a href="'+link+'"></a>');
- });
- }(window.jQuery)
- });
- </script>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement