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)
-   -   'Read More' not displaying on custom category-posts-in-a-page (http://forum.bytesforall.com/showthread.php?t=6065)

maija Feb 27, 2010 10:11 AM

[SOLVED] 'Read More' not displaying on custom category-posts-in-a-page
 
The WP "Read More" (<!--more-->) works on the home page and in a regular WP category page, but it doesn't work (ie. the full post is displayed) on the page template I have created that displays category posts.

I found this thread:
http://forum.bytesforall.com/showthread.php?t=2592

...which seems like the problem I'm having, but when I add $query_string. to query_posts the template stops working and displays nothing from the loop. I'm new to PHP so maybe I'm applying it incorrectly. This is what I have added before the loop:

PHP Code:

<?php
$catID 
0;
if (
is_page('news')) {
  
$catID=4;
} elseif (
is_page('photos')) {
  
$catID=5;
} elseif (
is_page('national-team')) {
  
$catID=18;



if (
$catID) {

   
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
   
query_posts("cat=$catID&paged=$paged");
   
?>

query_posts($query_string. "cat=$catID&paged=$paged"); makes everything from the loop disappear.

lknyc Mar 2, 2010 03:16 PM

Hello,

I am having a similar problem.

PHP Code:

<?PHP /* This is added in based on http://forum.bytesforall.com/showthread.php?t=207 to create a category post page */
    
query_posts('cat=13'); ?>
    
    
    <?php /* The LOOP starts here. Do this for all posts: */
    
while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>

I am trying to create a custom page using templates that will display a specific category. Everything works except the pagination. When I press "Older Articles", it just refreshes and shows the same posts on page 1.

Thanks for your help in advance!

:)

maija Mar 8, 2010 04:29 PM

Incidentally, though it didn't work before, I bashed again at all the options and this worked:

global $more;
// set $more to 0 in order to only get the first part of the post
$more = 0;

...added after the query_posts(), as suggested in the thread I linked above. I don't know why it didn't work before. I must have goofed something up. Or maybe I tried it in combination with adding $query_string. to query_posts, which did not work. My apologies for what turned out to be a redundant thread.

lknyc, your problem is different. The issue I was having was with the "Continue reading..." link that you can insert into long posts in Worpress. You are talking about older/newer links to other posts, rather than within a post. My php works for that so you might want to copy & paste it (adding the global $more; stuff above) and modify it to your own use.


All times are GMT -6. The time now is 11:23 PM.

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