I use arra theme and I can`t figure it out. I want the page of the top and then posts from a categori. how can I do this?
I use arra theme and I can`t figure it out. I want the page of the top and then posts from a categori. how can I do this?
Yes I`ve seen that, but don?t know how to do that with my theme..
This is the code which worked for my prev theme
<?php
/*
Template Name: PageOfPosts
Modified for iNove Theme in WP 2.8 by Robert Savage.
*/
get_header();
$options = get_option('inove_options');
if (function_exists('wp_list_comments'))
{
add_filter('get_comments_number', 'comment_count', 0);
}
// if this is a certain page ID, then set the category to a specific category id.
if (is_page('2881') )
{
$cat = array(8);
}
elseif (is_page('2270') )
{
$cat = array(10);
}
elseif (is_page('') )
{
$cat = array(14);
}
elseif (is_page('2042') )
{
$cat = array(14);
}
elseif (is_page('2390') )
{
$cat = array(14);
}
elseif (is_page('2042') )
{
$cat = array(14);
}
elseif (is_page('2042') )
{
$cat = array(14);
}
elseif (is_page('2042') )
{
$cat = array(14);
}
elseif (is_page('2042') )
{
$cat = array(14);
}
else
{
$cat = '';
}
$showposts = -1; // -1 shows all posts
$do_not_show_stickies = 1; // 0 to show stickies
$args=array(
'category__in' => $cat,
'showposts' => $showposts,
'caller_get_posts' => $do_not_show_stickies,
);
$my_query = new WP_Query($args);
?>
<div id="content" class="section">
<?php arras_above_content() ?>
<?php is_tag(); if ( have_posts() ) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php if ( is_category() ) : ?>
<h1 class="home-title"><?php printf( __('%s Archive', 'arras'), single_cat_title() ) ?></h1>
<?php elseif ( is_tag() ) : ?>
<h1 class="home-title"><?php printf( __('%s Archive', 'arras'), single_tag_title() ) ?></h1>
<?php elseif ( is_day() ) : ?>
<h1 class="home-title"><?php printf( __('Archive for %s', 'arras'), get_the_time( __('F jS, Y', 'arras') ) ) ?></h1>
<?php elseif ( is_month() ) : ?>
<h1 class="home-title"><?php printf( __('Archive for %s', 'arras'), get_the_time( __('F, Y', 'arras') ) ) ?></h1>
<?php elseif ( is_year() ) : ?>
<h1 class="home-title"><?php printf( __('Archive for %s', 'arras'), get_the_time( __('Y', 'arras') ) ) ?></h1>
<?php elseif ( is_author() ) : ?>
<h1 class="home-title"><?php _e('Author Archive', 'arras') ?></h1>
<?php else : ?>
<h1 class="home-title"><?php _e('Archives', 'arras') ?></h1>
<?php endif; ?>
<div id="archive-posts">
<?php arras_render_posts(null, arras_get_option('archive_display'), 'archive') ?>
<?php if(function_exists('wp_pagenavi')) wp_pagenavi(); else { ?>
<div class="navigation clearfix">
<div class="floatleft"><?php next_posts_link( __('« Older Entries', 'arras') ) ?></div>
<div class="floatright"><?php previous_posts_link( __('Newer Entries »', 'arras') ) ?></div>
</div>
<?php } ?>
</div><!-- #archive-posts -->
<?php else : ?>
<?php arras_post_notfound() ?>
<?php endif; ?>
<?php arras_below_content() ?>
</div><!-- #content -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>And this is the archive code I want to use now
<?php get_header(); ?>
<div id="content" class="section">
<?php arras_above_content() ?>
<?php is_tag(); if ( have_posts() ) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php if ( is_category() ) : ?>
<h1 class="home-title"><?php printf( __('%s Archive', 'arras'), single_cat_title() ) ?></h1>
<?php elseif ( is_tag() ) : ?>
<h1 class="home-title"><?php printf( __('%s Archive', 'arras'), single_tag_title() ) ?></h1>
<?php elseif ( is_day() ) : ?>
<h1 class="home-title"><?php printf( __('Archive for %s', 'arras'), get_the_time( __('F jS, Y', 'arras') ) ) ?></h1>
<?php elseif ( is_month() ) : ?>
<h1 class="home-title"><?php printf( __('Archive for %s', 'arras'), get_the_time( __('F, Y', 'arras') ) ) ?></h1>
<?php elseif ( is_year() ) : ?>
<h1 class="home-title"><?php printf( __('Archive for %s', 'arras'), get_the_time( __('Y', 'arras') ) ) ?></h1>
<?php elseif ( is_author() ) : ?>
<h1 class="home-title"><?php _e('Author Archive', 'arras') ?></h1>
<?php else : ?>
<h1 class="home-title"><?php _e('Archives', 'arras') ?></h1>
<?php endif; ?>
<div id="archive-posts">
<?php arras_render_posts(null, arras_get_option('archive_display'), 'archive') ?>
<?php if(function_exists('wp_pagenavi')) wp_pagenavi(); else { ?>
<div class="navigation clearfix">
<div class="floatleft"><?php next_posts_link( __('« Older Entries', 'arras') ) ?></div>
<div class="floatright"><?php previous_posts_link( __('Newer Entries »', 'arras') ) ?></div>
</div>
<?php } ?>
</div><!-- #archive-posts -->
<?php else : ?>
<?php arras_post_notfound() ?>
<?php endif; ?>
<?php arras_below_content() ?>
</div><!-- #content -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
How can I do this?
This topic has been closed to new replies.