How do I hide Categories?
-
Hello!
I tried to hide the categories on my page, I managed to hide the slider and those at the top of each individual page, but those in the beginning I could not.
In content.php, I delete thi line, but doesnt work:
<p class="post-category"><?php the_category(' / '); ?></p>Im using a child theme.
How could I?
-
Hi TheCrack,
Have you tried hiding them using CSS?
No maria, by editing php
Note: I just realized that only happens when you put the in list modeDo you need to eliminate categories throughout the site or just on one page? Could you also provide a link to the page/s where you want categories not to be displayed?
Cheers!
Someone can help me ?
Could you please provide a link to where you’d like to have the categories removed? From where I stand, I can’t see which template applies. In fact, besides content.php, the categories are also in content-featured.php. Try removing
<p class="post-category"><?php the_category(' / '); ?></p>from there as well.Here I explain, Maria.
To hide categories (those at the top of the single page?), edit /inc/page-title.php and remove:
<li class="category"><?php the_category(' <span>/</span> '); ?></li>The Categories on the Static Front Posts page:
That would be content/content-featured.php and remove this line:
<p class="post-category"><?php the_category(' / '); ?></p>I install the theme on my local server and see if I can replicate the issue you’re up against.
To remove the categories at the top of the single post page, add a folder called inc to your child theme and copy/paste page-title.php inside it. Open this file and delete
<li class="category"><?php the_category(' <span>/</span> '); ?></li>Save and refresh your site. It worked on my end, but only if I put page-title.php inside the inc folder in the child theme. If you don’t see any changes, empty your cache (Ctrl + f5).
This if you don’t want to use CSS to do this, which is what I would have done.
To eliminate the categories in the featured area, you’re right, delete
<p class="post-category"><?php the_category(' / '); ?></p>from featured-content.php, once you copy the file and paste it into your child theme. It works on my local install, it should work for you too.My problem is that I can not delete the categories of entries in the home, but only in standard list mode, because by default if I can.
In content.php, I delete thi line, but doesnt work:
<p class=”post-category”><?php the_category(‘ / ‘); ?></p>
How could I?
I’m sorry, but I deleted that line and add the expected result: the categories were not displayed on post excerpts on the home page. By deleting the line in the featured-content.php file, the categories on the featured post in the home page were not displayed. It seems deleting the_category() function from those templates worked for me. I don’t understand what you mean by standard list mode and by default. What’s in list mode?
In any case, adding
.post-category { display: none; }could easily get rid of the undesired categories. Perhaps I still don’t understand every aspect of the problem you’re having.
I did as you said, using css and problem solved, thank you very much.
Here I’ll show you the difference between default and standard mode list:
I have not been able to explain, the theme gives you the posilibility to switch to standard list mode.
Standar mode:
http://subefotos.com/ver/?95d807c7f3a6258c2fa1d1454ddde793o.jpg
Default mode:
http://subefotos.com/ver/?a90e3b10819071c8bf7f7b03b8ddf833o.jpg
Thank you, I understand what you mean now. Still, I was using the list mode and managed to delete the categories from the template files mentioned above. Perhaps there was something that interfered with it on your end.
Anyway, I’m glad you solved the problem:)
The topic ‘How do I hide Categories?’ is closed to new replies.
