This repository has been archived by the owner on Jan 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
134 lines (100 loc) · 5.99 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
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 include (TEMPLATEPATH.'/get-theme-options.php'); ?>
<?php get_header(); ?>
<div id="content">
<div id="homepage">
<?php if ($sweettooth_featuredpost == 'Uncategorized') { ?>
<div class="featuredtop">
<h2>Thanks for installing Baby Sweettooth!</h2>
<h3>It looks like this is the first time you've used this theme. That means you need to set it up.</h3>
<p>Head over to the <a href="<?php echo home_url(); ?>/wp-admin/themes.php?page=functions.php">theme options</a> page in your dashboard to get started or take a look at the <a href="<?php bloginfo('template_url'); ?>/readme.php">Readme</a> file included in this theme.</p>
<p>If you feel that you are seeing this message in error, make sure that the Featured Post section in the <a href="<?php echo home_url(); ?>/wp-admin/themes.php?page=functions.php">Baby Sweettooth Options</a> page is entered and is set to something other than <a href="<?php echo home_url(); ?>/?cat=1">'Uncategorized'</a>. (For that matter, make sure all the Featured sections are filled in.)</p>
</div>
<?php } ?>
<div id="homepagetop">
<div class="featuredtop">
<!-- this is the featured photo -->
<!-- photos for this section should be 625px wide. Smaller photos will be stretched to 625px wide and original height.
Larger photos will be scaled to 625px wide -->
<span id="featuredpic">
<?php if ($sweettooth_featuredpic != null) { ?>
<p align="center">
<?php if ($sweettooth_featuredlink != null) { ?><a href="<?php echo $sweettooth_featuredlink; ?>"><?php } ?>
<img src="<?php echo $sweettooth_featuredpic ?>" alt="<?php bloginfo('title'); ?>" />
<?php if ($sweettooth_featuredlink != null) { ?></a><?php } ?>
</p>
<?php } ?>
</span>
<p>
<!-- this is the featured post -->
<div id="featuredpost" <?php post_class();?>>
<?php $recent = new WP_Query("category_name=".$sweettooth_featuredpost."&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>
<h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<?php the_content_limit(350, "Read more..."); ?></div></p>
<?php endwhile; ?>
</div>
</div>
<!-- if the first two featured categories aren't blank -->
<?php if (($sweettooth_featuredcat1 != null) && ($sweettooth_featuredcat2 != null)) { ?>
<div id="homepageleft">
<!-- first, lets get some links -->
<?php
// Get the ID of a given category
$cat1 = get_cat_ID( $sweettooth_featuredcat1 );
// Get the URL of this category
$cat1_link = get_category_link( $cat1 );
// Get the ID of a given category
$cat2 = get_cat_ID( $sweettooth_featuredcat2 );
// Get the URL of this category
$cat2_link = get_category_link( $cat2 );
// Get the ID of a given category
$cat3 = get_cat_ID( $sweettooth_featuredcat3 );
// Get the URL of this category
$cat3_link = get_category_link( $cat3 );
?>
<div class="hpfeatured">
<h3><a href="<?php echo $cat1_link; ?>" title="<?php echo $sweettooth_featuredcat1; ?>"><?php the_ttftext ($sweettooth_featuredcat1, $echo = true, $style="klinkomitepink", $overrides="") ?></a></h3>
<div class="the_featured_content">
<?php $recent = new WP_Query("category_name=".$sweettooth_featuredcat1."&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>
<?php the_content_limit(80, "Read more..."); ?>
<div style="border-bottom:1px dotted #ef69b5; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div>
<?php endwhile; ?>
<b><a href="<?php echo $cat1_link; ?>" title="<?php echo $sweettooth_featuredcat1; ?>">Read More Posts From This Category</a></b>
</div>
</div>
</div>
<div id="homepageright">
<div class="hpfeatured">
<h3><a href="<?php echo $cat2_link; ?>" title="<?php echo $sweettooth_featuredcat2; ?>"><?php the_ttftext ($sweettooth_featuredcat2, $echo = true, $style="klinkomitepink", $overrides="") ?></a></h3>
<div class="the_featured_content">
<?php $recent = new WP_Query("category_name=".$sweettooth_featuredcat2."&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>
<?php the_content_limit(80, "Read more..."); ?>
<div style="border-bottom:1px dotted #ef69b5; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div>
<?php endwhile; ?>
<b><a href="<?php echo $cat2_link; ?>" title="<?php echo $sweettooth_featuredcat2; ?>">Read More Posts From This Category</a></b>
</div>
</div>
</div>
<?php } ?>
<?php if ($sweettooth_featuredcat3 != null) { ?>
<div id="homepagebottom">
<div class="hpbottom">
<h3><a href="<?php echo $cat3_link; ?>" title="<?php echo $sweettooth_featuredcat3; ?>"><?php the_ttftext ($sweettooth_featuredcat3, $echo = true, $style="klinkomitepink", $overrides="") ?></a></h3>
<div class="the_featured_content">
<?php $recent = new WP_Query("category_name=".$sweettooth_featuredcat3."&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>
<?php the_content_limit(350, "Read more..."); ?>
<div style="border-bottom:1px dotted #ef69b5; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div>
<?php endwhile; ?>
<!--This is where you can specify the archive link for each section. Replace the # with the appropriate URL-->
<b><a href="<?php echo $cat3_link; ?>" title="<?php echo $sweettooth_featuredcat3; ?>">Read More Posts From This Category</a></b>
</div>
</div>
</div>
<?php } ?>
</div>
<?php get_sidebar(); ?>
</div>
<!-- The main column ends -->
<?php get_footer(); ?>