Skip to content

Instantly share code, notes, and snippets.

@talstadler
Created June 14, 2011 21:26
Show Gist options
  • Select an option

  • Save talstadler/1025931 to your computer and use it in GitHub Desktop.

Select an option

Save talstadler/1025931 to your computer and use it in GitHub Desktop.
Redpyramids portfolio blog
/*
Theme Name: A Thematic Child Theme
Theme URI:
Description: Use this theme to start your Thematic Child Theme development.
Author: Ian Stewart
Author URI: http://themeshaper.com/
Template: thematic
Version: 1.0
Tags: Thematic
.
Thematic is © Ian Stewart http://themeshaper.com/
.
*/
/* Reset browser defaults */
@import url('../thematic/library/styles/reset.css');
/* Apply basic typography styles */
@import url('../thematic/library/styles/typography.css');
/* Apply a basic layout */
@import url('../thematic/library/layouts/2c-r-fixed.css');
/* Apply basic image styles */
@import url('../thematic/library/styles/images.css');
/* Apply default theme styles and colors */
/* It's better to actually copy over default.css into this file (or link to a copy in your child theme) if you're going to do anything outrageous */
@import url('../thematic/library/styles/default.css');
/* Prepare theme for plugins */
@import url('../thematic/library/styles/plugins.css');
p, h1, h2, h3, a{font-family:"Georgia", Times, serif;}
/*main area wrapper*/
#content{
float:left;
margin-left:200px;
width:600px;
position:relative;
top:40px;
}
/*the as we speak status*/
.aswespeak h2{
color: #8d8d8d;
font-style:italic;
font-size:23px;
line-height:30px;
}
/*the left menu*/
.welcome-blurb{
position:fixed;
top:190px;
left:50px;
font-size:12px;
line-height:17px;
font-style:italic;
}
.welcome-blurb a, .welcome-brub a:visited{
text-decoration: none;
color:black;
}
.welcome-blurb a:hover{
text-decoration: underline;
color:black;
}
#myname{
color: #FF0000;
}
/*wrapper to the first post*/
div .single-top{
width:500px;
}
/*the new tumbnail design*/
div .first-post{
width:500px;
float:left;
text-align:left;
margin-bottom:40px;
vertical-align:bottom;
}
img .first-post{
margin-right:100px;
}
div .older-post{
margin-bottom:20px;
margin-right:50px;
width:150px;
height:220px;
float:left;
text-align:left;
vertical-align:bottom;
}
/*the writing under ech tumbnail pic*/
.post-title a, .post-title a:visited {
font-size: 12px;
color: #8d8d8d;
line-height:20px;
text-decoration: none;
}
.post-title a:hover{
text-decoration: underline;
}
.post-date {
font-style:italic;
font-size:12px;
}
<?php
// removing header - white space - blog name etc.
function clear_header() {
remove_all_actions('thematic_header');
}
add_action('init', 'clear_header');
//the as we speak header instead
function aswespeak() {
if (is_home() & !is_paged()) {
echo ('<div class="aswespeak"><h2>[As we speak: '. get_bloginfo('description') .' ]<br /><br /></h2></div>');
}
}
// welcome text that shows only on homepage
function childtheme_welcome_blurb() {
if (is_home() & !is_paged()) {
echo '
<div class="welcome-blurb">
Red Pyramids is<br />
<span id="myname">Tal Stadler</span>&rsquo;s space for<br />
design and words /<br />
words and design<br />
________________<br />
<br />
Search different angle<br />
<a href="">date</a>/<a href="">type of work</a><br />
<br />
<img src="/wp-content/themes/thematicthemechild/images/left menu.png" /><br />
<a href="">@reach me</a>
</div>
';
}
}
add_action('thematic_before','childtheme_welcome_blurb');
//making the WP loop show tumbnails instead of posts in homepage
//Supporting thumbnails in WP:
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
}
set_post_thumbnail_size( 300, 250, true);
//removing the old loop - we dont want 2 loops
function remove_index_loop() {
remove_action('thematic_indexloop', 'thematic_index_loop');
}
add_action('init', 'remove_index_loop');
//my new loop
//the post format
function childtheme_post() {
echo '<a href="'. get_permalink() .'">';
the_post_thumbnail();
echo '</a><div class="post-date">';
the_time('j/n/Y');
echo '</div>';
the_title('<div class="post-title"><a href="'. get_permalink() .'">','</a></div>');
echo '</div>';
}
//the loop
function childtheme_index_loop(){
aswespeak(); //the as we speak part
$isfirst = 1; //first post will be bigger - so we need to know if we are on the first.
while ( have_posts() ) : the_post() ?>
<?php if ($isfirst){
set_post_thumbnail_size( 350, 350, true );
echo '<div class="first-post">';
childtheme_post();
set_post_thumbnail_size( 250, 250, true );
$isfirst = 0;
} else {
echo '<div class="older-post">';
childtheme_post();
}
endwhile;
}
add_action('thematic_indexloop', 'childtheme_index_loop');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment