elric1984
Member
Posted 4 years ago #
I'm having trouble making it so that only the excerpts of articles show on the category pages of my blog. As it is, the entire articles show. My blog is at http://www.nccg.info. Any detailed help would be appreciated, as I'm not entirely expert at coding. I used the WordPress Theme Generator (http://www.yvoschaap.com/wpthemegen/) to make my theme.
-Derek
miromiro
Member
Posted 4 years ago #
Hi Derek,
In your category.php page, replace
<?php the_post(); ?>
with
<?php the_excerpt(); ?>
See the excerpt for details.
elric1984
Member
Posted 4 years ago #
Hey, thanks for the help, but I looked at category.php and couldn't find the tag you mentioned. Its in wp-includes, right?
Hey, thanks for the help, but I looked at category.php and couldn't find the tag you mentioned. Its in wp-includes, right?
no. you are supposed to be looking at the category.php that is inside your current theme's directory.
if you dont have one, you will need to create one in order to accomplish what you are asking how to do.
elric1984
Member
Posted 4 years ago #
I don't have a category.php in my theme. Any ideas?
miromiro
Member
Posted 4 years ago #
You can just go ahead and create one:
http://codex.wordpress.org/Category_Templates
Don't worry, its not too painful :-)
elric1984
Member
Posted 4 years ago #
I have none of the files listed except for the index.php, the fourth one on the list. This is the code from my index.php. Any problems?
-------------------------
[Moderated: Too much code. Please consider placing the code in a text file on your site with a link here -or- use a pastebin service such as http://wordpress.pastebin.ca. Thanks!]
Just go ahead and copy it to category.php and run amuck :-)
elric1984
Member
Posted 4 years ago #
There is no category.php, though.
Here is the code again, this time in a text file: http://www.nccg.info/indexphp.txt
nolageek
Member
Posted 4 years ago #
Create a new file called category.php and copy/paste all of the code from index.php into it. That template will now be used to list categories. Then, change the_post() to the_excerpt();
elric1984
Member
Posted 4 years ago #
I did precisely that and it made my category pages (in this screen shot, my "Update Log" category) look like this:
http://www.nccg.info/categoryerror.jpg
elric1984
Member
Posted 4 years ago #
elric1984
Member
Posted 4 years ago #
Is there any way I can perhaps pay someone to fix the problem and if so, what would it cost?
miromiro
Member
Posted 4 years ago #
Hi Derek,
Try this: http://wordpress.pastebin.ca./705414
Save this page as category.php - upload it and see how you go...
elric1984
Member
Posted 4 years ago #
Yes, it works! Thanks, I owe you one! So what exactly did you do? :D
miromiro
Member
Posted 4 years ago #
No problem - just compare what you have now with what you posted here:
http://www.nccg.info/indexphp.txt
Glad to help.
nolageek
Member
Posted 4 years ago #
miromiro,
Out of curiosity - what did you change? I've been comparing the two for about 40 minutes now. heh.
theres one change:
<?php the_excerpt (); ?>
is now:
<?php the_content('Read the rest of this entry »'); ?>