How can I style this the same as the index or single or page?
Is this possible.
I just copied the one from codex, but I have to change something?
How can I style this the same as the index or single or page?
Is this possible.
I just copied the one from codex, but I have to change something?
A page of posts would be a Category, or an archive. If it is a custom page of posts (you queried a special category, etc), you should be able to use the same code that comes with a theme.
If you would like, explain what you are trying to achieve further and I may be able to help.
Yes
I made a page pageofposts.php with the code from the codex.
I have used that template for a page ( with a certain categori)
But the layout is different than my posts in the ordinary blog.
Is that because of the template or must that template have its own styling in the css.
#pageofposts ??
No, the CSS should style it the same as your site. Instead of copying code from the codex, open up your themes "Category.php" and copy/paste that. Then, customize the loop to only call your special category, something like this:
<?php $customQuery = new WP_Query(); $customQuery->query('cat=3&showposts=20');?>
<?php while ($customQuery->have_posts()) : $customQuery->the_post(); ?>
Then your code that handles the styling of your post, the copy/paste bit you got from Categories.php.
Then: <?php endwhile; ?>
Hm. OK
I don`t have a categori php
But a archive and archives
What`s the difference?
Tjis is the archive
<?php get_header(); ?>
<?php
$options = get_option('inove_options');
if (function_exists('wp_list_comments')) {
add_filter('get_comments_number', 'comment_count', 0);
}
?>
<?php if (is_search()) : ?>
<div class="boxcaption"><h3><?php _e('Search Results', 'inove'); ?></h3></div>
<div class="box"><?php printf( __('Keyword: ‘%1$s’', 'inove'), wp_specialchars($s, 1) ); ?></div>
<?php else : ?>
<div class="boxcaption"><h3><?php _e('Archive', 'inove'); ?></h3></div>
<div class="box">
<?php
// If this is a category archive
if (is_category()) {
printf( __('Archive for the ‘%1$s’ Category', 'inove'), single_cat_title('', false) );
// If this is a tag archive
} elseif (is_tag()) {
printf( __('Posts Tagged ‘%1$s’', 'inove'), single_tag_title('', false) );
// If this is a daily archive
} elseif (is_day()) {
printf( __('Archive for %1$s', 'inove'), get_the_time(__('F jS, Y', 'inove')) );
// If this is a monthly archive
} elseif (is_month()) {
printf( __('Archive for %1$s', 'inove'), get_the_time(__('F, Y', 'inove')) );
// If this is a yearly archive
} elseif (is_year()) {
printf( __('Archive for %1$s', 'inove'), get_the_time(__('Y', 'inove')) );
// If this is an author archive
} elseif (is_author()) {
_e('Author Archive', 'inove');
// If this is a paged archive
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
_e('Blog Archives', 'inove');
}
?>
</div>
<?php endif; ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); update_post_caches($posts); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><a class="title" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div class="info">
<span class="date"><?php the_time(__('F jS, Y', 'inove')) ?></span>
<?php if ($options['author']) : ?><span class="author"><?php the_author_posts_link(); ?></span><?php endif; ?>
<?php edit_post_link(__('Edit', 'inove'), '<span class="editpost">', '</span>'); ?>
<span class="comments"><?php comments_popup_link(__('No comments', 'inove'), __('1 comment', 'inove'), __('% comments', 'inove'), '', __('Comments off', 'inove')); ?></span>
<div class="fixed"></div>
</div>
<div class="content">
<?php the_content(__('Read more...', 'inove')); ?>
<div class="fixed"></div>
</div>
<div class="under">
<?php if ($options['categories']) : ?><span class="categories"><?php _e('Categories: ', 'inove'); ?></span><span><?php the_category(', '); ?></span><?php endif; ?>
<?php if ($options['tags']) : ?><span class="tags"><?php _e('Tags: ', 'inove'); ?></span><span><?php the_tags('', ', ', ''); ?></span><?php endif; ?>
</div>
</div>
<?php endwhile; else : ?>
<div class="errorbox">
<?php _e('Sorry, no posts matched your criteria.', 'inove'); ?>
</div>
<?php endif; ?>
<div id="pagenavi">
<?php if(function_exists('wp_pagenavi')) : ?>
<?php wp_pagenavi() ?>
<?php else : ?>
<span class="newer"><?php previous_posts_link(__('Newer Entries', 'inove')); ?></span>
<span class="older"><?php next_posts_link(__('Older Entries', 'inove')); ?></span>
<?php endif; ?>
<div class="fixed"></div>
</div>
<?php get_footer(); ?>
How could your way be achieved with this?
This topic has been closed to new replies.