• I am aware of many posts on this topic, and tried many of the solutions to those, but unfortunately I still was not able to resolve my problem.
    On my homepage I wish to include all News and Agenda posts, and not the posts of other categories.
    However, a plugin that excludes the other categories is of no use, since many newsitems also appear in another category (and that category should not be showed in total on the home page). (this is however how it is now on our homepage (www.nrin.nl), using RYO plugin for category visibility).

    I made a page on which I listed the News and Agenda posts using a plugin, that works. But when I set this page as my static homepage, it does not show. Somehow, no static page is shown (regardless of which page I choose as home page). So a static homepage with a non-static function seemed a solution, but unfortunately is not.

    I do not have a home.php, nor front-page.php.

    I tried to solve it by modifying ‘$query->is_home()’ in functions.php.
    I already included something in index.php to adjust the order of the posts in all category pages (I wanted to sort it by title, not by date). However, on the homepage I do want the order to be by date (in reverse order).

    Thank you very much for your suggestions. Please note that I’m a beginner ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author ronangelo

    (@ronangelo)

    Try this: https://ronangelo.com/topic/front-page-posts-from-specific-category/
    Note: Looking at your site, the category IDs for News and Agenda are 52 and 8.

    Thread Starter NRIN

    (@nrin)

    Thanks for your suggestion. Unfortunately is not working yet.
    I’ve got two questions:
    1) do I have to paste the suggested code at a specific place in functions.php, or can I put it anywhere? (so far, I don’t have anything else in the child theme functions, does it require something else?)
    And 2) do I separate the id-numbers of the two categories by a comma, or both between ‘ ‘ with a space in between, or something else…?
    Thank you!

    Theme Author ronangelo

    (@ronangelo)

    1) do I have to paste the suggested code at a specific place in functions.php

    No. Like you said, your child-theme functions.php is empty. There can’t be a “specific” place to put the code in.

    2) do I separate the id-numbers of the two categories by a comma

    Yes. Both numbers inside the same quotations.
    Example: $query->set( 'cat', '52,8' );
    If that doesn’t work try this:
    Example: $query->set( 'cat', array(52,8) );

    Thread Starter NRIN

    (@nrin)

    Thanks again, but unfortunately it still isn’t working…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show only TWO categories on home page’ is closed to new replies.