• Resolved vincedepalma

    (@vincedepalma)


    I am creating a site using pages as the base of the navigation. I have a page called News that i would like to display all the article content from the news category. I have tried placing the loop in the page template, but all i am getting is the content from the actual page itself. How would i go about getting the article content to display in the page? any help or a link would be great.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter vincedepalma

    (@vincedepalma)

    I just found the a simple solution by setting the Posts page to “News”. However more specifically i was hoping to break down the news section further by displaying only certain post categories on a specific page. Ex show only posts from category “Youth of the Month” on the page “Youth of the Month”. The work in progress is up for testing at https://incipere.com/pay/

    Thanks

    Thread Starter vincedepalma

    (@vincedepalma)

    Found a solution by placing

    php query_posts(‘cat=5&showposts=5’);

    before the loop, (change cat=X to the category you would like to display.

    thanks to:
    https://www.webdesignerwall.com/tutorials/wordpress-theme-hacks/

    Vince, I came up with the same solution for my site, but there is one problem. I am using the Pages widget as sub-navigation to display all sub-pages within this main menu option. However, when I add the php query_posts line before the loop in my page template, I loose the current_page_item class in the sub menu that indicates which page the user is on at the moment. If I remove the abovementioned line of code, the sub nav works properly, but my page doesn’t do what I want it to.

    You can check out the Meeting Minutes sub-page under the Government menu option at https://www.unionspringsny.com/wp.

    Thanks

    Vince, I figured it out.

    https://codex.www.ads-software.com/Pages#A_Page_of_Posts

    Thanks, anyway. (Meybe this will help others)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Displaying article Posts on a Page’ is closed to new replies.