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)
-   -   Category Page Listing - How to display: Post Title only (http://forum.bytesforall.com/showthread.php?t=351)

TotalBalance Feb 12, 2009 12:21 AM

Category Page Listing - How to display: Post Title only
 
Using WP 2.7 & A3 is there an easy way for a novice user to configure Category Pages to only display the Post Title of posts assigned to each Category? If so, can you also override the "Home" page number of posts listed to list all posts assigned to a category?

If not, which php file(s) & specific entries need to be modified to do what I'm asking?

I'm a real novice at this stuff so thx. in advance for any help.

P.S. Wasn't even sure if this was the correct forum to post my question so posted similar to WP forum post.

Flynn Feb 12, 2009 07:38 AM

Quote:

Originally Posted by TotalBalance (Post 1294)
Using WP 2.7 & A3 is there an easy way for a novice user to configure Category Pages to only display the Post Title of posts assigned to each Category?

In index.php, wrap each post part that you don't want to display (post-kicker, post-header, post-byline, post-bodycopy, post-pagination, post-footer) into a conditional statement:

PHP Code:

<?php if ( !is_category() ) { ?>
....
<?php ?>

All post parts are spaced out in the code of index.php and have some sort of headline on top such as
Code:

<!-- Post Body Copy -->
or
Code:

// Post Footer
It should be easy to figure out where a section starts and ends.

To exclude the post-bodycopy on category pages, wrap line ~ 122-137 into the conditional statement as described above
PHP Code:

<?php if ( !is_category() ) { ?>
        <!-- Post Body Copy -->                
        <div class="post-bodycopy clearfix">
        <?php if ((is_home() && $bfa_ata_excerpts_home == "Full Posts") OR 
        (
is_category() && $bfa_ata_excerpts_category == "Full Posts") OR 
        (
is_date() && $bfa_ata_excerpts_archive == "Full Posts") OR 
        (
is_tag() && $bfa_ata_excerpts_tag == "Full Posts") OR 
        (
is_search() && $bfa_ata_excerpts_search == "Full Posts") OR 
        (
is_author() && $bfa_ata_excerpts_author == "Full Posts") OR 
        
is_single() OR 
        
is_page() OR (is_home() AND !is_paged() AND $postcount <= $bfa_ata_full_posts_homepage) ) { 
            
$bfa_ata_more_tag_final str_replace("%post-title%"the_title(''''false), $bfa_ata_more_tag);
            
the_content(bfa_escape($bfa_ata_more_tag_final)); 
        } else { 
            
the_excerpt(); 
        } 
?>
        </div>    
<?php ?>

Quote:

Originally Posted by TotalBalance (Post 1294)
If so, can you also override the "Home" page number of posts listed to list all posts assigned to a category?

I did not understand this part of your question, please explain differently or with more details

TotalBalance Feb 12, 2009 11:11 AM

Thanks Flynn, worked like a charm. I even did same for my tag cloud:
Code:

<?php if ( !is_category() AND !is_tag() ) { ?>       
....
<?php } ?>

I was a little surprise I had to use AND instead of OR but hey, what do I know.

Quote:

Quote:
Originally Posted by TotalBalance http://forum.bytesforall.com/images/...s/viewpost.gif
If so, can you also override the "Home" page number of posts listed to list all posts assigned to a category?

I did not understand this part of your question, please explain differently or with more details
When displaying either a "Category" or "Tag" page, only the 1st 10 posts are displayed. At the bottom of the page is an "Older Entries" button to see the next 10 posts. I assume that's the default for # of posts displayed. I'm fine with that for everything but Category and Tag pages. For these I'd like all the posts displayed. Does that better explain what I'm trying to do?

Flynn Feb 12, 2009 12:40 PM

Quote:

Originally Posted by TotalBalance (Post 1325)
When displaying either a "Category" or "Tag" page, only the 1st 10 posts are displayed. At the bottom of the page is an "Older Entries" button to see the next 10 posts. I assume that's the default for # of posts displayed. I'm fine with that for everything but Category and Tag pages. For these I'd like all the posts displayed. Does that better explain what I'm trying to do?

In index.php, find

PHP Code:

    <?php // Do this for all posts:
    
while (have_posts()) : the_post(); $postcount++; ?>

(in an older Atahualpa version, you may not have the $postcount++; part) and replace with

PHP Code:

    <?php // Do this for all posts:  
    
if ( is_category() OR is_tag() ) { query_posts($query_string.'&posts_per_page=-1'); }
    while (
have_posts()) : the_post(); $postcount++; ?>

Also, the base setting of "10 per page" can be customized at Site Admin -> Settings -> Reading -> Blog pages show at most

TotalBalance Feb 12, 2009 01:32 PM

Thx. Flynn, once again that did it. Thx. also for the quick tutorial that I'll be able to reuse often.

Since it appears this type of customization requires a mod to the theme, I guess I'll request a feature enhancement to the Atahualpa 3 theme to make these changes via the Theme Options tab. Perhaps I'm wrong but as the number of posts increase for a blog, I've found users much prefer Category and Tag pages to list posts by Title only, without all the other fluff. Otherwise, it just takes too long to quickly locate/scroll to a particular post of interest. I wouldn't want to do it under the global "Read" options as I think it's only needed for the Category and Tag pages. Reasonable request?

Flynn Mar 3, 2009 11:17 AM

I might add things like that later but my to-do list is already quite long

TotalBalance Mar 3, 2009 11:45 AM

Understand. Let's say I tweak the default theme to do the things I need and save it. When I use the default theme for a new blog is there any reason I can't just overwrite the default phps with the mod ones? Or, after activating the theme are there blog/domain specific changes made to the files that should not be overwritten?

Flynn Mar 3, 2009 04:50 PM

You can always re-apply your mods to new versions. But (for now, while the theme is still changing a bit) you may have to find the right places inside the same files again. I.e. in 3.2.1 all theme options appearing in the files will be named something like $cur_opt['bfa_ata_option_name'] instead of $bfa_ata_option_name due to speed improvements. But that's already a rather big change. What you cannot do when applying your custom patches is to strictly go by line numbers and to assume everything is going to be identical in the new version, without even looking at the code.

I am also going to add "hooks" to the theme in a later version so all these custom file changes can be kept in a single file.

Oracle May 12, 2009 11:13 PM

RE: Category Page Listing - How to display: Post Title only

For version 3.3.3. How do I make it to work?

And how do I make it to list a certain number of posting(with only titles) in the category page?

Thanks for your help!

Flynn May 13, 2009 06:53 PM

Either wrap the post parts that you don't want into conditional tags http://codex.wordpress.org/Conditional_Tags, in index.php

Or make a copy of index.php as category.php and delete the post parts you don't want in there.

These are the post parts:

<?php bfa_post_kicker(); // Post Kicker: To edit the output, see functions/bfa_post_parts.php ?>

<?php bfa_post_headline(); // Post Headline: To edit the output, see functions/bfa_post_parts.php ?>

<?php bfa_post_byline(); // Post Byline: To edit the output, see functions/bfa_post_parts.php ?>

<?php bfa_post_bodycopy(); // Post Bodycopy: To edit the output, see functions/bfa_post_parts.php ?>

<?php bfa_post_pagination(); // Post Pagination: To edit the output, see functions/bfa_post_parts.php ?>

<?php // Archives Pages. Displayed on a specific static "Page" page, if configured at Theme Options -> Archives Pages:
bfa_archives_page(); // To edit the output, see functions/bfa_post_parts.php ?>

<?php bfa_post_footer(); // Post Footer: To edit the output, see functions/bfa_post_parts.php ?>



This is a conditional tag

<?php if ( is_category() ) { ?>
Do this only if this is a category page...
<?php } ?>

bcorrigan May 14, 2009 01:27 PM

You might want to look at the List Category Posts plugin. I use it to do what you want to do.

You create a page or post, then use short code to get an unordered list of your posts in the category by the category id. There are a few sorting and display options.

-Bill

ladylulu Oct 31, 2009 05:05 AM

Quote:

Originally Posted by TotalBalance
Using WP 2.7 & A3 is there an easy way for a novice user to configure Category Pages to only display the Post Title of posts assigned to each Category?
Wow. Thanks a lot for this Flynn! This is almost "near" to what I am looking for. Almost used my 6 hours just researching about this. Haven't try the one in post#2 though.

Anyway, hi Flynn, how about displaying post titles of a certain category in a page. Example, I have Articles, Blog, and Uncategorized as categories. then I only wanted to display post under Articles in a particular page. How do you do that? And titles of post should be arranged in unnumbered list. :D

I am afraid I need your reply as soon as possible. :( But I know you are busy too. :D So, if you have time kindly reply. Thanks a lot! :) Godspeed.

juggledad Oct 31, 2009 09:14 AM

please don't double post. See the answer I gave in http://forum.bytesforall.com/showthread.php?t=4140 post #5

techminto Nov 14, 2009 10:32 PM

hi my question is same How to display: Post Title only on category pages but as Flynn said i am not able to find the <!-- Post Body Copy --> in my index css file. i am using latest version pls help me.

techminto Nov 17, 2009 12:51 AM

hello i am not able to understand this process pls tell me from where to delete the code , hey where are you all pls reply me
i am not able to see catogory portion in main index file
pls help me

juggledad Nov 17, 2009 05:24 AM

did you try what was explained in http://forum.bytesforall.com/showthread.php?t=4140 post #5?

if you did and you have problems, what is happening
What version of Atahalpa are you running
What is your url?

uswgo Jan 27, 2010 12:22 PM

I need help with this.

I am using a more recent version of wordpress and can't find the certain line well actually I found something simular but cannot make the category pages only show excerpt text and title.

Can you help me with this?

What line do I need to find for wordpress 2.8 and 2.9?

I don't have a category.php but do have index.php

This is in my index.php code:

Code:


<div id="content">

        <div id="contentleft">
       
                <div class="postarea">
               
                <?php include(TEMPLATEPATH."/breadcrumb.php");?>
                       
                        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                        <h1><?php the_title(); ?></h1>
                       
                        <div class="date">
                       
                                <div class="dateleft">
                                        <p><span class="time"><?php the_time('F j, Y'); ?></span> by <?php the_author_posts_link(); ?> &nbsp;<?php edit_post_link('(Edit)', '', ''); ?> <br /> Filed under <?php the_category(', ') ?></p>
                                </div>
                               
                                <div class="dateright">
                                        <p><span class="comment"><a href="<?php the_permalink() ?>#respond">Leave a comment</a></span></p>
                                </div>
                               
                        </div>

                        <?php the_content(__('Read more'));?><div style="clear:both;"></div>
                       
                        <div class="postmeta">
                                <p><span class="tags">Tags: <?php the_tags('') ?></span></p>
                        </div>
                                       
                        <!--
                        <?php trackback_rdf(); ?>
                        -->
                       
                        <?php endwhile; else: ?>
                       
                        <p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
                       
                </div>
               
                <div class="adsense-post">
               
                        <!--To activate your Google AdSense ad, go to your WP dashboard and go to Design -> Revolution Church Options and enter your Google Adsense Code.-->
                       
                        <?php $adsense_468 = get_option('revchurch_adsense_468'); echo stripslashes($adsense_468); ?>
                                               
                </div>
                       
                <div class="comments">
       
                        <h4>Comments</h4>
                        <?php comments_template(); // Get wp-comments.php template ?>
                       
                </div>
               
        </div>
       
<?php include(TEMPLATEPATH."/sidebar.php");?>
               
</div>

<!-- The main column ends  -->

<?php get_footer(); ?>



All times are GMT -6. The time now is 07:40 AM.

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