Showing only one category on homepage
10 years ago
gamary
Member
Hello,
I've tried finding an answer on my own but with no success. I would like only one category to show on the homepage of my website using RetroPress. How do I do this? I'm guessing I have to modify something in theloop.php, but I'm not very good with PHP so I'm not sure what I should do. Thanks in advance for any help! Bertrand |
10 years ago
Dave
Support Service
Hi!
Please, try to add the following code: after the line:
in the file theloop.php. Of course, you have to change the category ID in the expression 'cat=2'. |
10 years ago
gamary
Member
Hello Dave,
Thank you for your answer and sorry for my very late reply. This works but my menus has links to various the various post categories, and they now all show only the category I indicated in theloop.php. My idea was to have only posts of the category 4 to show on the front page, and the other ones (category 1 and 2) show separately. If I add : query_posts('cat=4&showposts='.get_option('posts_per_page')); then the links to the "1" and "2" category show only posts from "4"... Any idea how to solve this? |
10 years ago
Tim Cantrell
Member
You can also use the "if" construct and the function "is_home()" (see the description here http://codex.wordpress.org/Function_Reference/is_home) to adjust your home page.
|
Leave a reply
Search by forum
SMThemes.com Support
-
Categories
- Framework
- Themes
- Affiliate Company
- Sponsorship Useful pages
- How to start using our themes
- Contacts