Consulter le code

Add files via upload

Ivan FELICITE a écrit le 07/05/2018 00:00:47
Affichage de 3 fichier(s) changé(s)
1 1
new file mode 100644
... ...
@@ -0,0 +1,44 @@
0
+<?php
1
+global $virtue, $virtue_sidebar;
2
+if ( isset( $virtue[ 'blog_archive_full' ] ) && 'full' === $virtue[ 'blog_archive_full' ] ) {
3
+	$summery    = 'full';
4
+	$postclass  = 'single-article fullpost';
5
+} else {
6
+	$summery 	= 'normal';
7
+	$postclass 	= 'postlist';
8
+}
9
+	$virtue_sidebar = true;
10
+	/**
11
+	* @hooked virtue_page_title - 20
12
+	*/
13
+	do_action( 'virtue_page_title_container' );
14
+	?>
15
+
16
+<div id="content" class="container">
17
+	<div class="row">
18
+		<div class="main <?php echo esc_attr( virtue_main_class() ); ?>  <?php echo esc_attr( $postclass );?>" role="main">
19
+
20
+		<?php if ( ! have_posts() ) : ?>
21
+			<div class="alert">
22
+				<?php esc_html_e( 'Sorry, no results were found.', 'virtue' ); ?>
23
+			</div>
24
+			<?php get_search_form();
25
+		endif;
26
+
27
+		if( 'full' === $summery ) {
28
+			while ( have_posts()) : the_post();
29
+				get_template_part( 'templates/content', 'fullpost' );
30
+			endwhile;
31
+		} else {
32
+			while (have_posts()) : the_post(); 
33
+				get_template_part( 'templates/content', get_post_format() );
34
+			endwhile;
35
+		}
36
+
37
+		/**
38
+		* @hooked virtue_pagination - 10
39
+		*/
40
+		do_action( 'virtue_pagination' );
41
+		?>
42
+
43
+		</div><!-- /.main -->
0 44
new file mode 100644
... ...
@@ -0,0 +1,61 @@
0
+<?php
1
+function virtue_lang_setup() {
2
+	load_theme_textdomain('virtue', get_template_directory() . '/languages');
3
+}
4
+add_action( 'after_setup_theme', 'virtue_lang_setup' );
5
+
6
+/*
7
+ * Init Theme Options
8
+ */
9
+require_once( trailingslashit( get_template_directory() ) . 'themeoptions/framework.php');        			// Options framework
10
+require_once( trailingslashit( get_template_directory() ) . 'themeoptions/options.php');     				// Options framework
11
+require_once( trailingslashit( get_template_directory() ) . 'themeoptions/options/virtue_extension.php'); 	// Options framework extension
12
+
13
+/*
14
+ * Init Theme Startup/Core utilities/classes
15
+ */
16
+require_once( trailingslashit( get_template_directory() ) . 'lib/utils.php');           					// Utility functions
17
+require_once( trailingslashit( get_template_directory() ) . 'lib/init.php');            					// Initial theme setup and constants
18
+require_once( trailingslashit( get_template_directory() ) . 'lib/sidebar.php');         					// Sidebar class
19
+require_once( trailingslashit( get_template_directory() ) . 'lib/config.php');          					// Configuration
20
+require_once( trailingslashit( get_template_directory() ) . 'lib/cleanup.php');        						// Cleanup
21
+require_once( trailingslashit( get_template_directory() ) . 'lib/nav.php');            						// Custom nav modifications
22
+require_once( trailingslashit( get_template_directory() ) . 'lib/metaboxes.php');     						// Custom metaboxes
23
+require_once( trailingslashit( get_template_directory() ) . 'lib/comments.php');        					// Custom comments modifications
24
+require_once( trailingslashit( get_template_directory() ) . 'lib/image_functions.php');        				// Image functions
25
+require_once( trailingslashit( get_template_directory() ) . 'lib/class-virtue-get-image.php');        		// Image Class
26
+require_once( trailingslashit( get_template_directory() ) . 'lib/custom.php');          					// Custom functions
27
+require_once( trailingslashit( get_template_directory() ) . 'lib/virtuetoolkit-activate.php'); 				// Plugin Activation
28
+
29
+/*
30
+* Woomcommerce Support
31
+*/
32
+require_once( trailingslashit( get_template_directory() ) . 'lib/woocommerce/woo-core-hooks.php'); 					// Woocommerce Core functions
33
+require_once( trailingslashit( get_template_directory() ) . 'lib/woocommerce/woo-archive-hooks.php'); 				// Woocommerce Archive functions
34
+require_once( trailingslashit( get_template_directory() ) . 'lib/woocommerce/woo-single-product-hooks.php'); 		// Woocommerce single product functions
35
+require_once( trailingslashit( get_template_directory() ) . 'lib/woo-account.php'); 								// Woocommerce account functions
36
+
37
+/*
38
+ * Template Hooks
39
+ */
40
+require_once( trailingslashit( get_template_directory() ) . 'lib/authorbox.php');         					// Author box
41
+require_once( trailingslashit( get_template_directory() ) . 'lib/template_hooks/portfolio_hooks.php'); 		// Portfolio Template Hooks
42
+require_once( trailingslashit( get_template_directory() ) . 'lib/template_hooks/post_hooks.php'); 			// Post Template Hooks
43
+require_once( trailingslashit( get_template_directory() ) . 'lib/template_hooks/page_hooks.php'); 			// Post Template Hooks
44
+
45
+/*
46
+ * Init Widgets
47
+ */
48
+require_once( trailingslashit( get_template_directory() ) . 'lib/widgets.php');         					// Sidebars and widgets
49
+
50
+/*
51
+ * Load Scripts
52
+ */
53
+require_once( trailingslashit( get_template_directory() ) . 'lib/admin_scripts.php');          				// Admin Scripts
54
+require_once( trailingslashit( get_template_directory() ) . 'lib/scripts.php');        						// Scripts and stylesheets
55
+require_once( trailingslashit( get_template_directory() ) . 'lib/custom-css.php'); 			    			// Fontend Custom CSS
56
+
57
+/**
58
+ * Note: Do not add any custom code here. Please use a custom plugin or child theme so that your customizations aren't lost during updates.
59
+ * https://www.kadencethemes.com/child-themes/
60
+ */
0 61
\ No newline at end of file
1 62
new file mode 100644
... ...
@@ -0,0 +1,155 @@
0
+<?php
1
+/*
2
+Template Name: Portfolio Grid
3
+*/
4
+
5
+global $post; 
6
+$portfolio_category 	= get_post_meta( $post->ID, '_kad_portfolio_type', true ); 
7
+$portfolio_items 		= get_post_meta( $post->ID, '_kad_portfolio_items', true );
8
+$portfolio_order 		= get_post_meta( $post->ID, '_kad_portfolio_order', true );
9
+$portfolio_lightbox 	= get_post_meta( $post->ID, '_kad_portfolio_lightbox', true );
10
+$portfolio_cropheight 	= get_post_meta( $post->ID, '_kad_portfolio_img_crop', true );
11
+$portfolio_column 		= get_post_meta( $post->ID, '_kad_portfolio_columns', true );
12
+$portfolio_item_excerpt = get_post_meta( $post->ID, '_kad_portfolio_item_excerpt', true );
13
+$portfolio_item_types 	= get_post_meta( $post->ID, '_kad_portfolio_item_types', true ); 
14
+if( isset( $portfolio_order ) ) {
15
+	$p_orderby = $portfolio_order;
16
+} else {
17
+	$p_orderby = 'menu_order';
18
+}
19
+if( $p_orderby == 'menu_order' || $p_orderby == 'title' ) {
20
+	$p_order = 'ASC';
21
+} else {
22
+	$p_order = 'DESC';
23
+}
24
+if( $portfolio_category == '-1' || empty( $portfolio_category ) ) {
25
+	$portfolio_cat_slug = ''; 
26
+	$portfolio_cat_ID 	= '';
27
+} else {
28
+	$portfolio_cat 		= get_term_by ( 'id',$portfolio_category,'portfolio-type' );
29
+	$portfolio_cat_slug = $portfolio_cat -> slug;
30
+	$portfolio_cat_ID 	= $portfolio_cat -> term_id;
31
+}
32
+$portfolio_category = $portfolio_cat_slug;
33
+if( $portfolio_items == 'all' ) {
34
+	$portfolio_items = '-1';
35
+}
36
+if ( $portfolio_column == '2' ) {
37
+	$itemsize 		= 'tcol-md-6 tcol-sm-6 tcol-xs-12 tcol-ss-12';
38
+	$slidewidth 	= 559;
39
+	$slideheight 	= 559;
40
+} else if ( $portfolio_column == '3' ){
41
+	$itemsize 		= 'tcol-md-4 tcol-sm-4 tcol-xs-6 tcol-ss-12';
42
+	$slidewidth 	= 366;
43
+	$slideheight 	= 366;
44
+} else if ( $portfolio_column == '6' ){
45
+	$itemsize 		= 'tcol-md-2 tcol-sm-3 tcol-xs-4 tcol-ss-6';
46
+	$slidewidth 	= 240;
47
+	$slideheight 	= 240;
48
+} else if ( $portfolio_column == '5' ){
49
+	$itemsize 		= 'tcol-md-25 tcol-sm-3 tcol-xs-4 tcol-ss-6';
50
+	$slidewidth 	= 240;
51
+	$slideheight 	= 240; 
52
+} else {
53
+	$itemsize = 'tcol-md-3 tcol-sm-4 tcol-xs-6 tcol-ss-12';
54
+	$slidewidth = 269;
55
+	$slideheight = 269;
56
+}
57
+$crop = true;
58
+if ( !empty( $portfolio_cropheight ) ) {
59
+	$slideheight = $portfolio_cropheight; 
60
+}
61
+if ( $portfolio_lightbox == 'yes' ){ 
62
+	$plb = true;
63
+} else {
64
+	$plb = false;
65
+}
66
+/**
67
+* @hooked virtue_page_title - 20
68
+*/
69
+do_action( 'virtue_page_title_container' );
70
+?>
71
+<div id="content" class="container">
72
+	<div class="row">
73
+  		<div class="main <?php echo esc_attr( virtue_main_class() );?>" role="main">
74
+			<div class="entry-content" itemprop="mainContentOfPage" itemscope itemtype="http://schema.org/WebPageElement">
75
+				<?php get_template_part( 'templates/content', 'page' ); ?>
76
+			</div>
77
+			<div id="portfoliowrapper" class="rowtight">    
78
+            <?php 	
79
+            $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
80
+			$temp = $wp_query; 
81
+			$wp_query = null; 
82
+			$wp_query = new WP_Query();
83
+			$wp_query->query( array(
84
+				'paged' 		 => $paged,
85
+				'orderby' 		 => $p_orderby,
86
+				'order' 	 	 => $p_order,
87
+				'post_type' 	 => 'portfolio',
88
+				'portfolio-type' => $portfolio_cat_slug,
89
+				'posts_per_page' => $portfolio_items
90
+				)
91
+			 );
92
+
93
+			if ( $wp_query ) : 		 
94
+				while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
95
+				<div class="<?php echo esc_attr( $itemsize );?> kad_portfolio_fade_in">
96
+					<div class="portfolio_item grid_item postclass">
97
+					<?php if (has_post_thumbnail( $post->ID ) ) {
98
+							$img = virtue_get_image_array( $slidewidth, $slideheight, true, 'lightboxhover', null, get_post_thumbnail_id( $post->ID ) );
99
+							?>
100
+							<div class="imghoverclass">
101
+								<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" class="kt-intrinsic" style="padding-bottom:<?php echo esc_attr( ( $img['height']/$img['width'] ) * 100 );?>%;">
102
+									<?php echo '<img src="'.esc_url( $img['src'] ).'" width="'.esc_attr( $img['width'] ).'" height="'.esc_attr( $img['height'] ).'" '.wp_kses_post( $img['srcset'] ).' class="'.esc_attr( $img['class'] ).'" alt="'.esc_attr( $img['alt'] ).'">';
103
+									?>
104
+								</a> 
105
+							</div>
106
+							<?php if($plb) { ?>
107
+								<a href="<?php echo esc_url( $img['full'] ); ?>" class="kad_portfolio_lightbox_link" title="<?php the_title_attribute();?>" data-rel="lightbox">
108
+									<i class="icon-search"></i>
109
+								</a>
110
+							<?php } 
111
+					} ?>
112
+						<a href="<?php the_permalink() ?>" class="portfoliolink">
113
+							<div class="piteminfo">   
114
+								<h5><?php the_title();?></h5>
115
+								<?php if( $portfolio_item_types == true ) {
116
+									$terms = get_the_terms( $post->ID, 'portfolio-type' );
117
+									if ( $terms ) {?>
118
+										<p class="cportfoliotag">
119
+											<?php $output = array(); 
120
+											foreach( $terms as $term ){ 
121
+												$output[] = $term->name;
122
+											} 
123
+											echo esc_html( implode( ', ', $output ) ); ?>
124
+										</p>
125
+									<?php } 
126
+								} 
127
+								if( $portfolio_item_excerpt == true ) {?>
128
+									<p><?php echo esc_html( virtue_excerpt( 16 ) ); ?></p>
129
+								<?php } ?>
130
+							</div>
131
+						</a>
132
+					</div>
133
+				</div>
134
+				<?php endwhile; else: ?>
135
+					<div class="error-not-found">
136
+						<?php esc_html_e( 'Sorry, no portfolio entries found.', 'virtue' ); ?>
137
+					</div>
138
+				<?php endif; ?>
139
+			</div> <!--portfoliowrapper-->           
140
+			<?php
141
+			/**
142
+			* @hooked virtue_pagination - 10
143
+			*/
144
+			do_action( 'virtue_pagination' );
145
+
146
+			$wp_query = $temp;  // Reset 
147
+			wp_reset_postdata();
148
+
149
+			/**
150
+            * @hooked virtue_page_comments - 20
151
+            */
152
+			do_action('virtue_page_footer');
153
+			?>
154
+		</div><!-- /.main -->
0 155
\ No newline at end of file