forked from roots/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
141 lines (105 loc) · 3.58 KB
/
Copy pathfunctions.php
File metadata and controls
141 lines (105 loc) · 3.58 KB
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
138
139
140
141
<?php
/**
* Roots includes
*
* The $roots_includes array determines the code library included in your theme.
* Add or remove files to the array as needed. Supports child theme overrides.
*
* Please note that missing files will produce a fatal error.
*
* @link https://github.com/roots/roots/pull/1042
*/
$roots_includes = array(
'lib/utils.php', // Utility functions
'lib/init.php', // Initial theme setup and constants
'lib/wrapper.php', // Theme wrapper class
'lib/sidebar.php', // Sidebar class
'lib/config.php', // Configuration
'lib/activation.php', // Theme activation
'lib/titles.php', // Page titles
'lib/nav.php', // Custom nav modifications
'lib/gallery.php', // Custom [gallery] modifications
'lib/scripts.php', // Scripts and stylesheets
'lib/extras.php', // Custom functions
);
foreach ($roots_includes as $file) {
if (!$filepath = locate_template($file)) {
trigger_error(sprintf(__('Error locating %s for inclusion', 'roots'), $file), E_USER_ERROR);
}
require_once $filepath;
}
unset($file, $filepath);
if( ! function_exists('it_recommend_posts') ) {
function it_recommend_posts(){
$post_array = array(
'posts_per_page' => 2,
'order' => 'DESC',
'post_status' => 'publish',
'ignore_sticky_posts' => 1
);
$r = new WP_Query( $post_array );
if ($r->have_posts()) :
$i=0;
?>
<?php
while ($r->have_posts()) :
$r->the_post();
?>
<div class="half"><div class="">
<div class="entry-thumbnail pull-left">
<a class="thumbnail" href="<?php the_permalink() ?>">
<?php the_post_thumbnail('thumbnail' ); ?>
</a>
</div>
<p class="pull-left">
<small><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?> </a></small>
<p>
<div class="clearfix"></div>
</div></div>
<?php
$i++;
endwhile;
?>
<div class="clearfix"></div>
<?php
wp_reset_postdata();
endif;
}
}
if( ! function_exists('it_recommend_posts') ) {
function it_recommend_posts(){
$post_array = array(
'posts_per_page' => 2,
'order' => 'DESC',
'post_status' => 'publish',
'ignore_sticky_posts' => 1
);
$r = new WP_Query( $post_array );
if ($r->have_posts()) :
$i=0;
?>
<?php
while ($r->have_posts()) :
$r->the_post();
?>
<div class="half"><div class="">
<div class="entry-thumbnail pull-left">
<a class="thumbnail" href="<?php the_permalink() ?>">
<?php the_post_thumbnail('thumbnail' ); ?>
</a>
</div>
<p class="pull-left">
<small><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?> </a></small>
<p>
<div class="clearfix"></div>
</div></div>
<?php
$i++;
endwhile;
?>
<div class="clearfix"></div>
<?php
wp_reset_postdata();
endif;
}
}