-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
executable file
·143 lines (118 loc) · 5.55 KB
/
archive.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
138
139
140
141
142
143
<?php
get_header();
if(!$wp_query) global $wp_query;
if( is_category( array('3','4','5','6','7','8') ) )
query_posts( array_merge( array( 'posts_per_page' => 50 ) , $wp_query->query ) );
?>
<div id="content">
<?php is_tag() ?>
<?php if (have_posts()) : ?>
<?php include('sidebar_left.php');?>
<div class="main ieFix <?php ditoLargeClass();?>">
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h2 class="orange <?php ditoLargeClass();?>"><?php
if (is_category('54') || is_category('56') || is_category('57') || is_category('58') || is_category('59') || is_category('60') || is_category('61')){
echo 'Come ho fatto a...';
} elseif (is_category('47') || is_category('50')){
echo 'Sogni, segni, disegni';
}
else{
single_cat_title();
}
?></h2>
<?php /* If this is a tag archive */
foreach( (get_the_category() ) as $category) {
if($category->cat_name != 'Percorsi in evidenza'){
$catName = $category->cat_name;
// echo $catName;
// echo '<h2 class="orange">'.$catName.'</h2>';
}
}
$pageId = $wpdb->get_var ("SELECT post_id FROM $wpdb->postmeta WHERE meta_value = '$catName'");
$pageContent = $wpdb->get_var ("SELECT post_content FROM $wpdb->posts WHERE ID = '$pageId' AND post_status = 'publish'");
if (!empty($pageContent)) {
echo '<div class="intro">'.$pageContent.'</div>';
}
} elseif( is_tag() ) { ?>
<h2 class="orange">Cosa vuol dire<?php //single_tag_title(); ?></h2>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h2 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h2>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h2 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h2>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h2 class="pagetitle">Author Archive</h2>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2 class="pagetitle">Blog Archives</h2>
<?php } ?>
<?php while (have_posts()) : the_post();
if (is_category('47') || is_category('50')){
$author = get_post_meta($post->ID, "Author Name", $single=true);
$taleAuthor = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE post_title = '$author' AND post_status = 'publish'");
}
if (!empty($pageContent)) { ?>
<?php if(!in_category(4) || !in_category(141) || !in_category(44) || !in_category(55) || !in_category(138)){?>
<div class="post <?php ditoLargeClass();?>">
<a name="a_<?php the_ID(); ?>" />
<h3 id="post-<?php the_ID(); ?>" class="post-title yes-intro"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<?php } else {?>
<a name="a_<?php the_ID(); ?>"></a>
<h3 id="post-<?php the_ID(); ?>" class="post-title services"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<?php
}
} else {?>
<a name="a_<?php the_ID(); ?>" />
<?php if (is_category('47')){?>
<h3 id="post-<?php the_ID(); ?>" class="post-title no-intro"><a href="<?php the_permalink() ?>" rel="bookmark">
<em><?php the_title(); ?></em></a></h3> <a href="<?php echo $taleAuthor->guid;?>" class="authorLink authorArchive"> <?php echo $author;?></a>
<?php } elseif(is_category('50')) {?>
<h3 id="post-<?php the_ID(); ?>" class="post-title no-intro marginBottom"><a href="<?php echo $taleAuthor->guid;?>"> <?php echo $author;?></a></h3>
<?php }else{ ?>
<h3 id="post-<?php the_ID(); ?>" class="post-title no-intro"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<?php
}
} ?>
<!--<small><?php the_time('l, F jS, Y') ?></small>-->
<?php if (!empty($pageContent)) { ?>
<div class="entry <?php ditoLargeClass();?>">
<?php }elseif (is_category('47')){?>
<div class="entry entryWithMarginTop">
<?php
} else{?>
<div class="entry no-intro <?php ditoLargeClass();?>">
<?php }
if(is_category(50)){
displayPictures();
the_content();
}
elseif (is_category('54') || is_category('56') || is_category('57') || is_category('58') || is_category('59') || is_category('60') || is_category('61') || is_category('47') || is_category(141) || is_category(55) || is_category(44) || is_category(138)) {
the_excerpt();
}
elseif( is_category('4') || is_category('3') || is_category('5') || is_category('6') || is_category('7') || is_category('8'))
{
ditoDoExerpt(30);
}
else {
the_content();
}
?>
<?php if(!in_category(4) || !in_category(141) || !in_category(44) || !in_category(55) || !in_category(138)){?>
</div>
<?php }?>
<?php if (!empty($pageContent)) { ?>
</div>
<?php }?>
<?php endwhile; ?>
<?php do_action('dito_printAdditionalContent'); ?>
<?php twentyeleven_content_nav( 'nav-below' ); ?>
</div>
<?php else : ?>
<?php endif; ?>
<?php
if( !is_category( array('rassegna', 'gli-eventi', 'arte-spettacoli-appuntamenti', 'convegni-e-seminari') ) )
get_sidebar();
?>
</div>
<?php get_footer(); ?>