0
votes

I am having some problems structuring a Wordpress Website. Basically this website will have the following pages:

  • Home
  • Portfolio
  • News
  • Contact

The home will be designed by the index.php, that is no problem. In this page I will show some of the posts that should be in the News and some that should appear in Portfolio. The pages Portfolio and News should present a list of posts that match this category. Contact is a normal static page.

My idea was to create a static page for portfolio and for news and to change its theme so I get a list of posts matching this category and handle it. But I found out that this does not work as I thought because pages are not meant to this. For this reason some functions (as the_content) do not work. So I found about Category Templates, which seem exactly what I want. But now my problem is: my menu is being built automatically and I find it nice. Using the category page template would cause me to need to build it manually, which looks like (for a newbie) a bad smell, once it can be built automatically.

Is the approach with Home->index.php, news and portfolio -> category template and contact -> static page a nice approach? How would I build the menu in a elegant way with this approach?

Thanks! Oscar

2

2 Answers

1
votes

I don't think your approach was the best, I would have used page templates to pull the different layout/type of pages and use the front-page.php to create the homepage.

But every dev has his own way, I guess.

I think you can easily solve your problem building the menu with the built-in menu builder of wordpress. You can go in Appearance > Menu if your theme is compatible with that.

Check further documentation here

hope it helps! cheers

0
votes

In wordpress you can add static page or categories or any other pages to wordpress menu. For creating menu in wordpress see this links. creating menu