forked from hultsfredskommun/hultsfredskommun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.php
83 lines (78 loc) · 3.29 KB
/
content.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
<?php
/**
* The default template for displaying content
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
global $blog_id, $external_blog;
$classes = "summary";
$classes .= (is_sticky())?" sticky":"";
$classes .= ($external_blog)?" externalblog":"";
?>
<article id="post-<?php the_ID(); ?>" <?php echo "class='post gtm-dyn-article ".str_replace("hentry", "", implode(" ",get_post_class($classes)))." '"; ?>>
<div class="article-border-wrapper">
<div class="article-wrapper">
<div class="content-wrapper">
<div class="summary-content">
<?php $thumb = hk_get_the_post_thumbnail(get_the_ID(),'thumbnail-image', false, false);
if ($thumb != "") :
echo $thumb;
else : /* else default thumb; */
$options = get_option("hk_theme");
$src = $options["default_thumbnail_image"];
if (!empty($src)) :
?>
<div class="img-wrapper "><div><img class="slide" src="<?php echo $src; ?>" alt="Standardbild" title="Standardbild"></div></div>
<?php endif; endif;/*endif;*/ ?>
<?php
$externalclass = "";
$jstoggle = "js-toggle-article";
if ($external_blog) {
$jstoggle = "";
$href = get_permalink();
$title = "Länk till annan webbplats " . the_title_attribute( 'echo=0' );
}
else {
if (function_exists("get_field")) {
$href = get_field('hk_external_link_url');
$name = get_field('hk_external_link_name');
if (!empty($href))
{
$externalclass = "js-external-link ";
$title = "Extern länk till " . the_title_attribute( 'echo=0' );
}
}
if (empty($href)) {
$href = get_permalink();
$title = "Länk till " . the_title_attribute( 'echo=0' );
}
}
?>
<h1 class="entry-title"><a class="<?php echo $externalclass.$jstoggle; ?>" href="<?php echo $href; ?>" title="<?php echo $title; ?>" rel="bookmark"><?php the_title(); ?></a><span class="spinner"></span></h1>
<div class="entry-content">
<?php
if ($_REQUEST["action"] == "hk_search" && $_REQUEST["searchstring"] != "" && function_exists('relevanssi_do_query')) {
//relevanssi_the_excerpt(); // not showing same as search excerpt
//$content = apply_filters(‘relevanssi_excerpt_content’, get_the_content());//, $post, $query);
//print_r($post);
$excerpt = relevanssi_do_excerpt($post, $_REQUEST["searchstring"]);
$excerpt = relevanssi_highlight_terms($excerpt, $_REQUEST["searchstring"]);
echo '<a class="' . $externalclass.$jstoggle . '" href="' . $href . '" title="' . $title . '" rel="bookmark">';
echo $excerpt;
echo "</a>";
}
else {
the_excerpt();
}
?>
</div>
</div><!-- .summary-content -->
</div><!-- .content-wrapper -->
<?php //require("inc/hk-aside-content.php"); ?>
<?php //require("inc/single_footer_content.php"); ?>
</div>
</div>
<span class='hidden article_id'><?php the_ID(); ?></span>
</article><!-- #post-<?php the_ID(); ?> -->