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)
-   -   [SOLVED] "Read more" on category template pages is dead (http://forum.bytesforall.com/showthread.php?t=2592)

mcphoto Jul 22, 2009 05:35 PM

[SOLVED] "Read more" on category template pages is dead
 
Hi folks - got a strange one...

For this particular site, almost every page comes from a custom template (to allow us to use categories as a search/CMS menu).

So, I have dozens of templates with the following after the "get header" section (the top line makes the page display categories, the remaining lines I've pasted already exist in each PHP file - hope this shows you where the new line of code is pasted):

Code:

<?php query_posts('cat=44&showposts='.get_option('posts_per_page')); ?>


<?php // If there are any posts:
if (have_posts()) : $postcount == 0; ?>
<?php if( is_category() AND function_exists('page2cat_output')) { page2cat_output($cat); } // This is for the plugin Page2Cat http://wordpress.org/extend/plugins/page2cat/ ?>


Works just fine, but in this theme, it eliminates the "read more" and shows the entire post.

You can see it in action at this link: http://landalerts.com

Click on any drop-down menu and you'll get a templated category page. Even the home page is a category page (I have to use templates for this, since the page-2-cat plugin just shows post titles).

On every post, there's a "MORE" tag after the first sentence. I've tried setting up a non-template page and the "more" works fine. Any ideas?

We don't want to go with excerpts for this function, as it's one more field for people to enter, and copywriters won't be entering data on this site.

Thanks for ANY help!!! MC

Flynn Jul 23, 2009 08:40 AM

You may have to add $query_string. to query_posts

<?php query_posts($query_string. 'cat=44&showposts='.get_option('posts_per_page')); ?>

Or add

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

after query_posts, or do both

mcphoto Jul 23, 2009 09:23 AM

THANKS Flynn - it took both to make it work; my lack of php skills meant I had to try a few places with the paste, but works globally now - thanks for the quick help - MC


All times are GMT -6. The time now is 04:50 PM.

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