Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Excerpts, Read more, Pagination (http://forum.bytesforall.com/forumdisplay.php?f=20)
-   -   Question on Excerpts vs Full Posts on a Custom Template Page (http://forum.bytesforall.com/showthread.php?t=20071)

riw777 Apr 6, 2013 03:28 PM

Question on Excerpts vs Full Posts on a Custom Template Page
 
Y'all:

I'm trying to create a page that will show just the two most recent posts within a specific category on a single page. I know I can do this with a category page, but for various reasons, I can't use a category page (not least of which is I can't figure out how to customize category pages by replacing their sidebars with a sidebar plugin). So, what I've done is to create a custom template with the following:

==

<?php
/*
Template Name: Current Classes
*/
?>

<?php
list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();
get_header();
extract($bfa_ata);
global $bfa_ata_postcount;
?>

<?php get_header(); ?>

<article>

<?php
$temp = $wp_query; $wp_query= null;
$wp_query = new WP_Query(); $wp_query->query('showposts=2&cat=22' . '&paged='.$paged);
while ($wp_query->have_posts()) : $wp_query->the_post(); ?>

<h2><a href="<?php the_permalink(); ?>" title="Read more"><?php the_title(); ?></a></h2>
<?php the_content(); ?>

<?php endwhile; ?>

<?php wp_reset_postdata(); ?>

</article>

<?php get_footer(); ?>

==

This is pretty minimal, no "older entries," and things like that, just the two posts out of the one category. The problem I'm having is that the posts are still showing up as excerpts (albeit without "more" links at the bottom), rather than full posts.

Does anyone have any idea of how to get the full post to show up? I'm using the_content() rather than the_excerpt(), so I should be getting the full content. Atahaulpa also seems to be overriding the link at the top of the post in some way, replacing the "read more" that should be coming from this code with "permanent link to..."

I've looked at index.php, and tried to start with that as a template instead of just pulling together a generic template like this, but... I can't figure the loop out in index.php. It looks like it's calling in to functions that I can't find, and I probably don't want to modify, to display the post.

Any help appreciated.

Thanks!

:-)

Russ

juggledad Apr 7, 2013 05:23 AM

why not use the 'multi column/custom query' that comes with the theme? use your same query, set the custom fields to:
HTML Code:

custom_query showposts=2&cat=22
number_of_columns 1
number_of_full_posts 2
show_page_text no
posts_above_the_column 2
show_page_title no

and you are done.

riw777 Apr 8, 2013 11:48 AM

Oh --I hadn't thought of that... Thanks for that idea, it might solve some other issues I'm having with the formatting of these pages.

Thanks!

:-)

Russ


All times are GMT -6. The time now is 09:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.