ThemeShaper Forums » Thematic

[closed]

magazine style homepage

(2 posts)
  • Started 2 years ago by kim4true
  • Latest reply from kim4true
  • This topic is resolved
  1. I followed instructions in a book, "Build Your Own Wicked WordPress Themes", and successfully got my homepage rearranged so that it displays a limited number of posts across a full-width page, with a thumbnail for the first post.

    See it at: http://debraclopton.com/w/

    I am a novice with php, and the book left me hanging on a few points. Here are the things I am having difficulty with. Any and all help would be appreciated:

    1. I want the post for the first thumbnail to display the whole book-cover, but it is getting cropped.

    2. I'd like to be able to post a custom excerpt for the homepage so that the styling is better, and more text is included, but can't work out where/how to filter that.

    3. I'd like to display only one category on the homepage, but again, I'm stumped!

    ==============================================

    Here's the code on my child-theme's function.php:

    <?php

    // Add support for thumbnails
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(300, 482, false);
    add_image_size('homepage-thumbnail',300, 482, false);

    // output a list of top-level pages
    function authorsite_footer_pagelinks() {
    echo '<ul id="simplepages">';
    wp_list_pages('depth=1&sort_column=menu_order&title_li=');
    echo '';
    }

    // Add Header Image
    function thematic_logo_image() {
    echo '<span id="header-image"></span>';
    }
    add_action('thematic_header','thematic_logo_image',6);

    // custom homepage loop
    function authorsite_indexloop() {
    query_posts("posts_per_page=4");
    $counter = 1;
    if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div id="post-<?php the_ID() ?>" class="<?php thematic_post_class() ?>">
    <?php thematic_postheader();
    if ($counter == 1 && has_post_thumbnail() && !is_paged()) {
    the_post_thumbnail('homepage-thumbnail');
    } ?>
    <div class="entry-content">
    <?php the_excerpt(); ?>
    " class="more"><?php echo more_text() ?>
    <?php $counter++; ?>
    </div>
    </div><!-- .post -->
    <?php endwhile; else: ?>
    <h2>Oops!</h2>
    <p>Something is not working quite right here. Please contact us and let us know using the contact link you'll find in the top menu. Thank you!</p>
    <?php endif;
    wp_reset_query();
    }

    ?>

    ==============================================

    and here's the home.php:

    <?php

    // calling the header.php
    get_header();

    // action hook for placing content above #container
    thematic_abovecontainer();

    ?>

    <div id="container">

    <?php thematic_abovecontent(); ?>

    <div id="content">

    <?php

    // create the navigation above the content
    thematic_navigation_above();

    // calling the widget area 'index-top'
    get_sidebar('index-top');

    // action hook for placing content above the index loop
    thematic_above_indexloop();

    // action hook creating the index loop
    //thematic_indexloop();

    // a custom homepage loop
    authorsite_indexloop();

    // action hook for placing content below the index loop
    thematic_below_indexloop();

    // calling the widget area 'index-bottom'
    get_sidebar('index-bottom');

    // create the navigation below the content
    // thematic_navigation_below();

    ?>

    </div><!-- #content -->

    <?php thematic_belowcontent(); ?>

    </div><!-- #container -->

    <?php

    // action hook for placing content below #container
    thematic_belowcontainer();

    // calling the standard sidebar
    // thematic_sidebar();

    // calling footer.php
    get_footer('homepage');
    ?>

    ==============================================

    and this is the homepage specific css from the stylesheet:

    /* =Homepage specific styles
    -------------------------------------------------------------- */
    body.home #container {
    float: none;
    margin: 0;
    width:960px;
    }
    body.home #content {
    width:900px;
    overflow:hidden;
    margin: 0 0 0 10px;
    }

    body.home .hentry {
    width: inherit;
    }

    body.home ul#simplepages {
    width: 940px;
    margin: 0 auto;
    }

    body.home ul#simplepages li {
    list-style-type: none;
    display: inline;
    margin-right: 30px;
    }

    body.home div.p1 {
    font-size: 120%;
    height: 325px;
    }

    body.home div.p1 img {
    float: left;
    margin-right: 30px;
    }

    body.home div.p2 {
    clear: left;
    }

    body.home div.p2,
    body.home div.p3,
    body.home div.p4 {
    width: 270px;
    float: left;
    margin-top: 22px;
    }

    body.home div.p3 {
    margin-left: 30px;
    margin-right: 30px;
    }

    Posted 2 years ago #
  2. O.K., I haven't got the homepage working yet, but the rest of the posts benefited from this post about excerpts: http://forums.themeshaper.com/topic/how-to-make-excerpts-roll-over-and-say-uncle?replies=11#post-23633

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.