WordPress.org

Ready to get started?Download WordPress

Forums

Style changes for index vs. page created with template copied from index.php? (2 posts)

  1. Todd
    Member
    Posted 7 years ago #

    When creating a page template (new.php) by duplicating the index.php code and then creating a page using the new.php template, why does the style look different from the index page itself? If new.php is renamed and used as the index.php (and the template named removed) the styles of the new index look fine. I'm not understanding the application of styles to the page as it appears in the context of the index vs. a page created with a template based on the same code. How can I make the new page based on the new.php template look like the index page (same blog formatting etc.)?

  2. Todd
    Member
    Posted 7 years ago #

    Clarification: The following code yields different a style appearance when pasted into either index.php or new.php (the new page template)...

    <?php get_header() ?>

    <div id="container">
    <div id="content" class="hfeed">

    <?php while ( have_posts() ) : the_post(); ?>

    <div id="post-<?php the_ID() ?>" class="<?php barthelme_post_class() ?>">
    <div class="post-container">
    <div class="post-content">
    <h3 class="entry-title">" title="<?php printf(__('Permalink to %s', 'barthelme'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title() ?></h3>
    <div class="entry-content">
    <?php the_excerpt('<span class="more-link">'.__('Continue reading ›', 'barthelme').'</span>') ?>

    </div>
    </div>
    </div>
    <div class="entry-meta">
    <span class="entry-date">"><?php unset($previousday); printf(__('%1$s', 'barthelme'), the_date('Y m d', false)) ?></span>
    <?php if ( !is_author() ) : ?><?php barthelme_author_link(); ?><?php endif; ?>
    <span class="entry-category"><?php if ( !is_category() ) { echo the_category('<br/>'); } else { $other_cats = barthelme_other_cats('<br/>'); echo $other_cats; } ?></span>
    <span class="entry-comments"><?php comments_popup_link(__('Comments (0)', 'barthelme'), __('Comments (1)', 'barthelme'), __('Comments (%)', 'barthelme')) ?></span>
    <?php edit_post_link(__('Edit', 'barthelme'), "\t\t\t\t\t<span class='entry-edit'>", "</span>\n"); ?>
    </div>
    </div>

    <?php endwhile ?>

    </div>
    </div>

    <?php get_sidebar() ?>
    <?php get_footer() ?>

Topic Closed

This topic has been closed to new replies.

About this Topic