• Hey all, I was wondering, I think I’m using too many PHP files than necessary, and I’m getting more and more confused what which file is exactly doing. Just created my first theme. The site is meant to let people find bars (by category also) I have:

    Custom post type: Bars
    Taxonomy: Type
    Terms: Music/Dance/Lounge/Irish Pub etc

    There are several ways the bars can show up:

    mydomain.com/bars (so they have a list of ALL the bars)
    mydomain.com/type/TERM (so they see all the bars from 1 specific term)
    Or by searching

    I have the layout/structure of this post type the same for all those 3 ways. Now I’m using:

    archive-bars.php
    content-bars.php
    taxonomy.php
    search.php

    I’m not using a single.php because I disabled clickable titles, so they won’t even see single posts. There are more files of course, but for the views I mentioned before those files are used. I have the feeling I’m using too many for this purpose, or is this normal?

    Ever since someone told me to “DON’T USE TOO MANY PHP FILES!” I’m always concerned I am ??

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • ‘lo again ??

    Assuming you’re still using a child theme and based on what you’ve described about the site, I don’t think you’re using too many .php files. Three of those files are needed for your custom post types and the fourth is a custom search template (which you’d need in this situation).

    Thread Starter timm49

    (@timm49)

    Hey! Wow yo’re quick as always ??

    Hehe no I actually started creating it from scratch yesterday, just for a test:

    https://www.iwannagoout.nl

    Very plain and simple still, didn’t even embed all the fonts yet and everything – I just needed sth to play around with to practice on creating a WP Theme.

    I actually started creating it from scratch yesterday

    Then I definitely wouldn’t worry about the extra template files. Remember that is exactly how the WP templating system is designed to work.

    Thread Starter timm49

    (@timm49)

    Okay cool, thanks! Yeah didn’t do a proper job yet, very basics – no sidebars / footer / 404 template and everything. But ech, it was a good way to make a first start ??

    We all have to start somewhere. ??

    Thread Starter timm49

    (@timm49)

    True that! Well, I’m mostly happy that I’m now slowly getting comfortable with the way WP is handling the file structure. I always try try try, and only afterwards read read read…not good in this case.

    But it’s lovely that now within 15 mins I can easily add and style a simple sidebar. The more I’m going to build, the more advanced stuff I can do soon. And the most important thing – I’m loving working with it!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘php files confusion’ is closed to new replies.