Viewing 13 replies - 1 through 13 (of 13 total)
  • vtxyzzy

    (@vtxyzzy)

    Find the file where the Loop starts ( if (have_posts()) … ) and place the following code just ahead of that line. You will need to enclose this code in <?php and ?> tags if the line that has the have_posts() starts with a <?php tag.

    global $wp_query;
    query_posts(
       array_merge(
          $wp_query->query,
          array('posts_per_page' => 10)
       )
    );
    Thread Starter gracie-yo

    (@gracie-yo)

    That didn’t work…and I did enclosed it with php tags. Should it be somewhere in the category.php? There’s no have_posts in there though…

    vtxyzzy

    (@vtxyzzy)

    You must identify which file is being used for the category display.

    Please put the code in a pastebin and post a link to it here.

    Thread Starter gracie-yo

    (@gracie-yo)

    It looks like the display is in the category.php file. I hope I dud this right!

    <script src=”https://pastebin.com/embed_js.php?i=KUtYtXKV”></script&gt;

    vtxyzzy

    (@vtxyzzy)

    OK. Twenty Ten and its derivatives have things in different places than most other themes.

    Make a copy of loop.php named loop-content.php. Put the code I showed, enclosed in php tags, just before the Display navigation comment line, like this:

    * @since Twenty Ten 1.0
     */
    ?>
    
    <?php
    global $wp_query;
    query_posts(
       array_merge(
          $wp_query->query,
          array('posts_per_page' => 10)
       )
    );
    ?>
    
    <?php /* Display navigation to next/previous pages when applicable */ ?>
    <?php if ( $wp_query->max_num_pages > 1 ) : ?>
    Thread Starter gracie-yo

    (@gracie-yo)

    I’m going to sound dumb here but…

    I can see the loop.php file, but how do I make a copy of it? Can I do this within WordPress?

    vtxyzzy

    (@vtxyzzy)

    You will need to use ftp or a file manager such as that found in cPanel with your hosting service.

    Thread Starter gracie-yo

    (@gracie-yo)

    Okay – i did it, but it still doesn’t work. Do I need to remove the loop.php file?

    vtxyzzy

    (@vtxyzzy)

    No, loop.php needs to stay there for queries other than categories.

    Please put a copy of your loop-category.php file in a pastebin and post a link here.

    Thread Starter gracie-yo

    (@gracie-yo)

    There is no loop-category.php…do you mean the loop-content.php?

    vtxyzzy

    (@vtxyzzy)

    I am terribly sorry, I told you the wrong name. It should be loop-category.php, not loop-content.php.

    Rename it to loop-category.php and see if it works.

    Thread Starter gracie-yo

    (@gracie-yo)

    Success at last!!! Thanks so much for your help ??

    vtxyzzy

    (@vtxyzzy)

    Thanks for hanging in there with me.

    Now, please use the dropdown at top right to mark this topic ‘Resolved’ so that anyone researching a similar problem can see that there is a solution.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How to Show More Excerpts on Category Pages’ is closed to new replies.