Forums

[resolved] Removing 'read more' link on Category page (14 posts)

  1. ckadet
    Member
    Posted 1 year ago #

    Hello,

    I want to remove the 'read more' button under these posts on this category page and also perhaps increase the number of words it shows for each post. I don't know what file to edit.

    http://habitswap.com/?cat=4

    Thanks,

    Chris

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Try creating a new template file for that category.

  3. ckadet
    Member
    Posted 1 year ago #

    Is there an easier way?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Not if you want to only make this change for 1 specific category.

  5. ckadet
    Member
    Posted 1 year ago #

    I want to be able to have multiple categories that have the same template as I am describing.

  6. ckadet
    Member
    Posted 1 year ago #

    Basically, for all of the "category" pages, I want it to have the template in the example above MINUS the read more button.

  7. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    In that case you could amend your current category template file (presumably catgeory.php) by adding <?php global $more; $more = -1;?> before the start of the Loop.

  8. ckadet
    Member
    Posted 1 year ago #

    Where is the start of the loop? :S

  9. ckadet
    Member
    Posted 1 year ago #

    I am editing category.php as we speak, from wp-includes.

  10. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    No!!

    You need to edit your theme's category.php file.

  11. ckadet
    Member
    Posted 1 year ago #

    LOL. Right. I am in categories.inc.php... I believe that is the file. It reads:

    <?php
    $parents = getParentCategories();
    foreach($parents as $parent) {
    echo "<div class='box'><h3>id )."'>$parent->name</h3>";
    $children = getChildCategories($parent->id);
    $index = 0;
    foreach ($children as $child) {
    if($index%4 == 0) {
    echo "

      ";
      }
      remove_filter('term_description','wpautop');
      if ( category_description( $child->id ) == "") {
      $linkdescription = $parent->name.' » '.$child->name;
      } else {
      $linkdescription = category_description( $child->id );
      } echo

      "

    • id )."'
      title='$linkdescription'>$child->name
    • ";

      $index ++;
      if($index%4 == 0 || $index == count($children)) {
      echo "

    ";
    }
    }
    echo "</div>";
    }
    ?>

    So where would I put the line?

  12. ckadet
    Member
    Posted 1 year ago #

    These are the other files that I can access from WordPress.

    404 Template
    (404.php)

    All Posts Page Template
    (posts.php)

    Comments
    (comments.php)

    Footer
    (footer.php)

    Header
    (header.php)

    Main Index Template
    (index.php)

    Newsletter Page Template
    (newsletter.php)

    Page Template
    (page.php)

    Search Form
    (searchform.php)

    Search Results
    (search.php)

    Sidebar
    (sidebar.php)

    Single Post
    (single.php)

    Theme Functions
    (functions.php)

    categories.inc.php
    (categories.inc.php)

    home.php
    (home.php)

    popup_comment.inc.php
    (popup_comment.inc.php)

    thumb.inc.php
    (thumb.inc.php)

    thumbBigger.inc.php
    (thumbBigger.inc.php)

    timthumb.php
    (timthumb.php)

    widgets.php
    (widgets.php)

    Styles
    Stylesheet
    (style.css)

  13. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    My guess is that your theme is re-using the index.php template file to display your categories and archives. If you are posting small code snippets can you post them inside backticks (or use the code button) so that the code remains readable. Larger code blocks should be placed in the the pastebin and the pastebin url posted here.

  14. ckadet
    Member
    Posted 1 year ago #

    Excellent! I removed a line in the index file and it fixed my problem. Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic