-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
78 lines (71 loc) · 2.85 KB
/
home.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
<?php
// Exit if accessed directly
if (!defined('ABSPATH'))
exit;
/**
* Home Page
*/
?>
<?php get_header(); ?>
<!-- home header image -->
<div id="top-container" style="background: url('<?php header_image(); ?>') no-repeat top center; background-size: 960px 261px;">
<div id="sub-nav" role="tooltip">
<?php get_sidebar('left'); ?>
</div>
</div>
<div id="bottom-container">
<div id="news"><!--TYPO3SEARCH_begin-->
<div id="c222" class="csc-default">
<div class="news-latest-container">
<?php
wp_reset_query();
if (ICL_LANGUAGE_CODE == 'fr') {
$catId = 2;
$moreNews = '">Plus d’actualités</a>';
} elseif (ICL_LANGUAGE_CODE == 'it') {
$catId = 3;
$moreNews = '">Altre novità</a>';
} elseif (ICL_LANGUAGE_CODE == 'en') {
$catId = 1;
$moreNews = '">more news</a>';
} else {
$catId = 1;
$moreNews = '">Weitere News</a>';
}
$category = get_category($catId);
query_posts(array(
'posts_per_page' => 4,
'cat' => $catId,
));
print '<h1>' ;
print $category->cat_name;
print ':</h1>';
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<div class="news-latest-item news-item">
<?php if (has_post_thumbnail()) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_post_thumbnail('home-news', array('class' => 'alignleft cat-post-img')); ?></a>
<?php else: ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/news-ohne-bild.png" height="212px" width="150px"></a>
<?php endif; ?>
<h2><a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a></h2>
</div>
<?php
}
}
print '<a class="more_news" href="';
print get_category_link( $catId );
print $moreNews;
wp_reset_query();
?>
</div>
</div><!--TYPO3SEARCH_end-->
</div>
<div id="border">
<?php if (!dynamic_sidebar('home-widget-1')) : ?><?php endif; ?>
</div>
</div>
<div id="home-footer">
<?php get_footer(); ?></div>