-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcustom-page-t1.php
137 lines (103 loc) · 3.02 KB
/
custom-page-t1.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/**
*
* This is the template for the portfolio custom post type
*
* ---------------------
* INFO:
*
* To create the side images you need to post the images on the
* content area of the theme and the pictures will automatically
* get into the side image format.
*
* ---------------------
*
* @package perfectPortfolio
*
* Template Name: side image
* Template Post Type: portfolio
**/
?>
<?php
get_header();
while ( have_posts() ) : the_post();
?>
<div class="side-image">
<div class="my-container back-button" style="padding-left:25px;" >
<a href='<?php echo esc_url( get_home_url() . '#portfolio' ); ?>' >
<div class="back background-image" style="background-image:url( '<?php echo esc_attr( get_template_directory_uri() . '/img/back.png' ); ?>' )">
</div><!-- .back .background-image -->
<p>BACK</p>
</a>
</div><!-- .my-container .back-button -->
<div class="my-container">
<div class="row">
<div class="col-lg-12 brief ">
<h1>
<?php the_title(); ?>
</h1>
<h2>
<?php
// Echo the categories of this portfolio post.
$taxonomy = 'portfolio_categories';
$terms = get_the_terms( get_the_ID(),$taxonomy ); // Get all terms of a taxonomy.
if ( $terms && ! is_wp_error( $terms ) ) :
?>
<?php
foreach ( $terms as $term ) {
esc_html( $term->name );
}
?>
<?php endif; ?>
</h2>
<div class="right-image">
<?php
// Strip all content from the images and echo the content.
$content = get_the_content();
preg_match_all( "/<img\s[^>]*?src\s*=\s*['\"]([^'\"]*?)['\"][^>]*?>/", $content, $images );
$i = 0;
foreach ( $images[1] as $image_src ) :
?>
<div class="background-image images" style="background-image:url( <?php echo esc_attr( $images[1][ $i ] ); ?> )">
</div>
<?php
$i++;
endforeach;
?>
</div><!-- .right-image -->
<?php
// Strip all content from the text and store the.
// images url inside the $image variable.
stripFromAttachments_filter( get_the_content() , 'image' );
?>
<h3>Details</h3>
<?php
$value = get_post_meta( $post->ID , '_choices_amount' , true );
get_side_image_portfolio_details( $value,$post->ID );
?>
</div><!-- .col-lg-12 -->
</div><!-- .row -->
</div><!-- .my-container -->
<div class="container">
<div class="row">
<div class="col-lg-4 col-5">
<?php
if ( isset( $_GET['category'] ) ) :
get_last_link_of_portfolio( $post->ID , 'portfolio_categories',sanitize_text_field( wp_unslash( $_GET['category'] ) ) );
endif;
?>
</div><!-- .col-lg-4 .col-5 -->
<div class="col-lg-4 col-2">
</div><!-- .col-lg-4 .col-2 -->
<div class="col-lg-4 col-5">
<?php
if ( isset( $_GET['category'] ) ) :
get_next_link_of_portfolio( $post->ID , 'portfolio_categories',sanitize_text_field( wp_unslash( $_GET['category'] ) ) );
endif;
?>
</div><!-- .col-lg-4 .col-5 -->
</div><!-- .row -->
</div><!-- .container -->
</div><!--custom-page-t1 -->
<?php
endwhile;