• Resolved christianboyce

    (@christianboyce)


    I want to show excerpts when someone clicks on a Category link. Currently, it shows full blog posts. This makes for a very long page. I think I found something in archive.php that explains what to do, but I don’t understand it. Here’s what I found:

    <?php
    /* Include the Post-Format-specific template for the content.
    * If you want to override this in a child theme, then include a file
    * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    */
    get_template_part( ‘content’, get_post_format() );
    ?>

    So, I would create a file called (let’s say) “content-excerpt.php” and then upload it into the same directory as archive.php. I don’t know what that file will look like (that’s Problem #1), so I need help with that. I also don’t know how to “call” it in the archive.php file (that’s Problem #2). Do I change the line “get_template_part(‘content’,get_post_format() ); to get_template_part(‘content-excerpt’,get_post_format() ); ?

    If you have an example file it would help me. I’m not afraid to experiment a bit so if I had a starting point I may be able to figure things out. As long as I end up with a page full of excerpts rather than full posts I’m happy. Would be great if I could make it match the look of my page https://christianboyce.com/every-blog-post. That page seems to be formatted in a very default way and I like it a lot.

    Excerpts like the ones here https://christianboyce.com/every-blog-post would be nice for searches too.

Viewing 15 replies - 1 through 15 (of 20 total)
  • Hello christianboyce,
    To show category link with excerpt you have to first copy whole index.php file and rename it as category.php
    If it doesn’t work then Can you please send me your whole theme folders structure.

    Thanks

    Theme Author Carolina Nymark

    (@poena)

    Hi!
    Is this customizer option not working for you?
    “Check this box to show the excerpt instead of the full content on the front page, blog listing and archives.”

    Thread Starter christianboyce

    (@christianboyce)

    It’s not. I was excited to find the option (before writing in here) but I could not get it to work. Here’s an example of a page where I get the full content of each post.

    https://christianboyce.com/category/how-tos

    I have unchecked and rechecked the box but there’s no effect for me.

    Perhaps something else I have done is interfering. I do use a plug-in to let me make category pages manually. But those are “real” pages. The situation I want to handle here is when someone clicks on a category name and the page is built dynamically, as sort of a search.

    Theme Author Carolina Nymark

    (@poena)

    What is the name of the plugin?

    Hello christianboyce,

    The excerpt is working fine to me after I make certain changes to the theme.You can see the output here: The Link

    The changes I made were:
    1.I created a new file called “category.php” and copied whole content of archive.php and pasted inside category.php
    2. Then I upload category.php into the same directory as archive.php
    3.Finally In customizer option I checked the box.”Check this box to show the excerpt instead of the full content on the front page, blog listing and archives.”

    I Hope that it will help in resolving your issue.
    Thanks!!

    Thread Starter christianboyce

    (@christianboyce)

    https://www.ads-software.com/plugins/list-category-posts/other_notes/

    It’s “List Category Posts.” I use it to show the posts that match a couple of categories– for example, posts that have the category “Mac” and the category “How-To.” That leads to this page:

    https://christianboyce.com/how-tos/how-tos-macs

    There, I’ve use the short code from List Category Posts and I get a result I like. That page, and others like it, are hard-coded by me. They are not the kind of pages that get created when someone clicks on a category name next to one of my posts.

    I may have made an error in assigning multiple categories to my posts. Maybe I should have, instead, assigned them multiple TAGS. But, now that I’m here, I wonder if I can make it all work the way I want.

    THANK YOU for your help.

    Thread Starter christianboyce

    (@christianboyce)

    Hello Madhusudan Pokharel, and thank you for your help. I like the way you did it and I was thinking of doing something similar. As the theme’s developer is corresponding with me on this I want to see what she suggests as I am always concerned with breaking the theme.

    It is interesting that you had to make the category.php page. The option you turned on in the Customizer is supposed to take care of everything, as I understand it. There is not supposed to be a need to make new files. But, you have demonstrated something that works– well done! And thank you very much.

    The result you showed in your link would work fine for me.

    Let’s see what Carolina says!

    I am glad that I could help you.

    Theme Author Carolina Nymark

    (@poena)

    Can you post the content of your category pages?

    Thread Starter christianboyce

    (@christianboyce)

    Sure. Here’s the code for one of my hand-coded pages, showing everything that is categorized with Category 3 and Category 21 (both):

    [catlist id=3+21 orderby=date order=desc no_posts_text=”Sorry, this page is being worked on. Please come back again!” excerpt=yes thumbnail=no date=no excerpt_strip=yes excerpt_size=60 excerpt_tag=p title_tag=strong]
    <hr>
    <iframe src=”https://widgets.itunes.apple.com/widget.html?c=us&brc=FFFFFF&blc=FFFFFF&trc=FFFFFF&tlc=FFFFFF&d=&t=&m=software&e=software,iPadSoftware&w=250&h=300&ids=&wt=search&partnerId=&affiliate_id=&at=10lLkg&ct=&#8221; frameborder=0 style=”overflow-x:hidden;overflow-y:hidden;width:250px;height: 300px;border:0px”></iframe>

    (the iframe thing at the end is for an App Store iTunes widget).

    Here’s a link to that page:

    https://christianboyce.com/reviews/iphone-and-ipad-software-reviews

    I don’t think I can show you how it really looks but the link will do that. Here’s the text for just the first two items (there are too many to show):

    IPHONE- AND IPAD-RELATED REVIEWS
    How to Track your Mileage Automatically, Using your iPhone
    If you use your car for work you need to keep track of your mileage. Maybe you get reimbursed by your company, or maybe you need the miles for your taxes. I used to track my mileage in a little notebook, or rather I tried to, but it was easy to forget to do it, and that’s exactly what I …

    How to Print Mailing Labels from an iPhone or iPad (2015 edition)
    It’s time to mail your holiday cards. You may recall from previous posts (this one from 2012, and this one from 2014) that when it comes to printing mailing labels from an iPhone or iPad, I really like the app called myCardLists. Lucky us: myCardLists’ developer updated his app recently, making it even easier to produce good-looking mailing labels directly …

    Theme Author Carolina Nymark

    (@poena)

    I missunderstood -this page is working, it’s the regular category listing that is not woring for you?

    I’ve tested it though and it works well for me without changes.
    Archive.php is a fallback for category.php.

    Rendering category archive index pages uses the following path in WordPress:

    1: category-{slug}.php – If the category’s slug is news, WordPress will look for category-news.php.

    2: category-{id}.php – If the category’s ID is 6, WordPress will look for category-6.php.

    3: category.php

    4: archive.php
    5: index.php

    So if you have a file named like 1-3, the archive page is overwritten.
    Do you have files like that?

    Thread Starter christianboyce

    (@christianboyce)

    You are right, the pages that I made using the shortcode “catlist” are great. The regular category listings don’t work for me– that is, they don’t show excerpts only. They show the full text. Are you saying that MY site works for you with excerpts, or that in general sites work with excerpts, with nothing more than checking the box in the Customizer? I wish it worked that way for me!

    Am I to go to my child theme (I made an “Aaron Child”) and change something in the Archive.php file? I’m not sure what my next step should be.

    Here is one of my category pages.

    https://christianboyce.com/category/how-tos

    The category is “how-tos”. When I load that page, it’s full content. Are you saying that for you, you see excerpts only? That is what I am trying to achieve.

    Theme Author Carolina Nymark

    (@poena)

    Do you have a file in your child theme called content.php? If you copied this file from an earlier version, it will overwrite the file from Aaron.

    Theme Author Carolina Nymark

    (@poena)

    You don’t need top copy the entire theme to do a child theme, only add/copy the files that you make changes to.

    Thread Starter christianboyce

    (@christianboyce)

    You were right, I had a content.php in the Aaron child theme… I removed it and everything is perfect! Thank you, thank you, thank you.

    I would still like to see if I could make these category pages look the way they do in my short-code [catlist] pages but I am not greedy. If there is a way for me to make that happen it would be great but I’m happy already.

    THANK YOU!

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘How to show excerpts for Category pages instead of full posts’ is closed to new replies.