Hello! I recently started learning CSS and PHP in order to customize the themes of my websites. I have a specific question: how can I remove previous post/next post links just from the posts, but not from the categories? I tried in style.css with the command .previous, .next { display: none; } but doing that the links from the category pages (where all posts are listed) also got removed. Thank you!
Do it on the template files. Your single posts is using a template (usually) called single.php, while your categories is (usually) using a template called archive.php (id is also being used by many other index pages such as blog page, terms page, etc. The code for prev/next nav are within both templates. Remove it from single.php but keep it in archive.php (or their derivatives). Search for "wordpress template hierarchy" for more info. If you do not want to mess with templates, your css might work if you give it this rule: .single .previous, .single .next { display: none; } Code (markup): I say "might" because I do not know which CSS class is defined in your theme. <div class="single"> is the most common one in wordpress universe. As always, you might want to do any of above in a child theme.