-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.php
134 lines (112 loc) · 3.46 KB
/
index.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
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package CAWeb
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Loads CAWeb <header> tag.
*/
get_header();
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
$caweb_post_format = function_exists( 'et_pb_post_format' ) ? et_pb_post_format() : get_post_format();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
$caweb_thumb = '';
$caweb_width = (int) apply_filters( 'et_pb_index_blog_image_width', 1080 );
$caweb_height = (int) apply_filters( 'et_pb_index_blog_image_height', 675 );
$caweb_classtext = 'et_pb_post_main_image';
$caweb_titletext = get_the_title();
$caweb_thumbnail = get_thumbnail( $caweb_width, $caweb_height, $caweb_classtext, $caweb_titletext, $caweb_titletext, false, 'Blogimage' );
$caweb_thumb = $caweb_thumbnail['thumb'];
if ( function_exists( 'et_divi_post_format_content' ) ) {
et_divi_post_format_content();
}
if ( ! in_array( $caweb_post_format, array( 'link', 'audio', 'quote' ), true ) ) {
if ( 'video' === $caweb_post_format && false !== ( et_get_first_video() === $caweb_first_video ) ) :
print esc_html( sprintf( '<div class="et_main_video_container">%1$s</div>', $caweb_first_video ) );
elseif ( ! in_array( $caweb_post_format, array( 'gallery' ), true ) && function_exists( 'et_get_option' ) && 'on' === et_get_option( 'divi_thumbnails_index', 'on' ) && '' !== $caweb_thumb ) :
?>
<a class="thumbnail-link" href="<?php the_permalink(); ?>">
<?php print_thumbnail( $caweb_thumb, $caweb_thumbnail['use_timthumb'], $caweb_titletext, $caweb_width, $caweb_height ); ?>
</a>
<?php
elseif ( 'gallery' === $caweb_post_format ) :
et_pb_gallery_images();
endif;
}
?>
<?php if ( ! in_array( $caweb_post_format, array( 'link', 'audio', 'quote' ), true ) ) : ?>
<?php if ( ! in_array( $caweb_post_format, array( 'link', 'audio' ), true ) ) : ?>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php endif; ?>
<?php
if ( function_exists( 'et_divi_post_meta' ) ) {
et_divi_post_meta();
}
if ( function_exists( 'et_get_option' ) && 'on' !== et_get_option( 'divi_blog_style', 'false' ) || ( is_search() && ( 'on' === get_post_meta( get_the_ID(), '_et_pb_use_builder', true ) ) ) ) {
truncate_post( 270 );
} else {
the_content();
}
?>
<?php endif; ?>
</article>
<?php
}
if ( function_exists( 'wp_pagenavi' ) ) {
wp_pagenavi();
} else {
get_template_part( 'includes/navigation', 'index' );
}
} else {
get_template_part( 'includes/no-results', 'index' );
}
?>
<style>
#searchform {
float: right;
}
.entry-title a {
color: #428bca;
}
.sform {
border-bottom: none;
}
.searched-for {
margin-top: 5px;
}
.query {
float: right;
}
.count {
float: left;
}
.divider {
display: block !important;
width: 100%;
height: 2px;
color: #e09900;
border-color: #e09900;
background-color: #e09900;
margin: 0;
}
</style>
<?php
/**
* Loads footer
*/
get_footer();