Thread Starter
Goonky
(@goonky)
Thanks for the direction.
I read through and checked my theme. My theme did not have a category.php page. Within the hierarchy listed in your link, the furthest mine went was to archive.php, so I am assuming based on that information that that’s the file I need to modify. So I copied the code from that theme and created a category.php fle and uploaded that to the same folder with the other theme files.
This immediately messed up the entire website – even before I had changed anything. I’m not sure why that would be since I had not altered any code. I thought wordpress would just grab the same information from the category.php page instead archive.php, but apparently I am missing something.
A further bump in the right direction would be appreciated. Thank you.
Thread Starter
Goonky
(@goonky)
I don’t know if it matters, since it does not mention this on the page you linked to, but I do have a page called single.php which seems to reference category posts.
Perhaps that is the page I need to edit?
Thread Starter
Goonky
(@goonky)
Ok, here is what I’ve figured out.
I figured out the category IDs for the categories that I want handled differently. I created .php files for those categories. This accomplished a lot in that now those category pages look different and all the other pages on the site are displaying correctly. So that’s good.
Now my issue is that I don’t know what to edit on those pages to make the list of categories it’s displaying disappear. Further, I can not add text directly to those specific categories.
For example:
If you click on the category Sight Singing, you get a page that shows all of my categories – even what doesn’t belong there. Further, if I open the post called Sight Singing and add text there, it does not show up on the site.
I basically want those category pages to display as a blank page, and I want to be able to add text to them like any other post.
Any direction appreciated. I thought perhaps I had to edit the loop, but it does not appear on the category-ID.php pages I copied from the archive.
I’ll get this eventually, but any help would be appreciated.
If you don’t want any ‘posts’ to display then your category template would just have
get_header();
get_sidebar();
get_footer();
right?
If you want to display different ‘text’ for each category you might consider using something like:
<?php
//display category name/description for use in category template
if ( is_category() ) {
$cat = get_query_var('cat');
$category=get_category($cat);
echo '<p>Category Title/Name: '. $category->name . '</p>'; //single_cat_title() will also work for this
echo '<p>Category Description: '. $category->description . '</p>';
}
?>
Also you could just put the text you want in the category template itself…
Thread Starter
Goonky
(@goonky)
Ok, I understand more now. Thank you.
I basically took out everything except the header, footer and sidebar. How that messed the side that the sidebar was on and I realized I needed to leave a div container there.
Placing text directly in the php file worked fine, and since I only have a few pages like this, I think I will do that. Is this good protocol?
Can I edit and format that php page just like any other page?
Is this good protocol?
I’m not enamored with that but you are the one that has to DO IT.
Can I edit and format that php page just like any other page?
Yes. Should be able to use the Theme editor as well.