ThemeForest

Where is the HTML!? - not a fan of new theme structures

16 posts
  • Has been a member for 2-3 years
  • Bought between 10 and 49 items
avatar12 says

This is a bit of a rant, a little bit of a plea… but mostly a request for theme suggestions.

I find myself yelling this a lot lately: “Where the heck is the HTML !?”

What I mean by that is this. New themes, at least all the ones I have been working with lately, seem to be in the habit of moving the HTML and PHP out of the theme templates.

So, if you open single.php you no longer see the HTML or PHP that is actually displayed by a post. Instead, what you see is a bunch of functions and calls to scripts and files that are buried elsewhere in the theme’s structure.

Why? I don’t know. I am not a developer, but I suspect it makes development easier. Beats me. All I know is that it significantly increases the complexity of the theme and makes customizing it a maddening effort in frustration.

If you do not have access to the actual DIVs and HTML and PHP that makes up a post, or a page, or your home page… how are you supposed to tweak, edit, or customize it?

The answer for most new themes seems to be “dashboard theme options”. That is great… assuming these theme options do everything you want them to, the way you want them to.

But what if they don’t?

Well, then you have to dig through folders and files and scripts and try to find where that HTML and PHP is being generated and then hope you can figure out how to edit it without blowing anything up.

This may just be the new direction of themes – indeed, maybe it is the new direction of WP. I can see how moving code out of the templates, burying it in scripts and function files, and adding lots of easy to use dashboard options would appeal to a larger audience (especially a larger audience of people not comfortable with WP, code, or customization)... so I do not begrudge developers for the change.

I just lament what I see as the lost of basic control over the customization of these themes.

With rant and plea over… my questions are:

1. Why exactly are themes developed in this way now?

and

2. Are there any new themes out there that make an effort to keep most of the core HTML and PHP accessible in the template files for easy customization?

4 months ago
1419 posts Bird is the word..
  • Has been a member for 4-5 years
  • Author had a File in an Envato Bundle
  • Interviewed on the Envato Notes blog
  • Exclusive Author
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • United States
  • Referred between 50 and 99 users
jonathan01 says

I agree with you and have to say we create our themes this way – html first – then insert php code to create the functions – functions file of theme does the horse work so that a theme can be customized easily – we do use theme options but basically even if you didn’t have a theme options panel it should work regardless to some degree (obviously some aspects will not as they are powered by the admin panel) – but generally I agree with you on this – what’s the point of making things very complex…

Interesting to see the answers on this one for sure.

Jonathan

4 months ago
28 posts
  • Has been a member for 1-2 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 100 and 499 items
  • United Kingdom
  • Referred between 10 and 49 users
Authentic says

Well the HTML is there, you just need to find it ;)

Some authors use functions for certain things, in some cases authors might have the HTML in the theme panel as a default setting so you edit it there, but I think most the time authors (I do this) organize their code into various folders so its actually easier for the buyer and then use include/require statements to pull the code in.

Example:

A wordpress theme might use the same loop on archive.php, blog-template.php, author.php and index.php, search.php. So instead of adding the code to all these files you create a new file called loop-entry.php and then in the other files you pull this code using something like:

<?php get_template_part( 'loop' , 'entry'); ?>

This way, there is 1 file with all the php/html required for that loop. So now you can edit 1 file and see the change across the whole site instead of having to edit every single theme file.

It’s the same idea as how WordPress has a header.php, sidebar.php, footer.php files – because they are used in multiple locations.

Another Example is for post formats authors might have a folder called “post-formats” and then a file for each post format (image.php, quote.php, gallery.php…etc). This makes it a whole lot easier to work with the theme as instead of having to go through 1 giant file with several if statements, you can easily edit the post formats individually.

I am not sure what themes you have bought. But at least when I make a theme I’m always thinking of how I can structure files so they are easier to edit and more dynamic. No one wants to buy a theme in which they have to edit 100 files just to change 1 thing. And I think this is the same logic a lot of other authors use.

You mention you “are not a developer”, yet you are buying and customizing themes. In which case you pretty much are. If you are always doing this, maybe you need to expand a bit more on your skills instead of spending so much time trying to guess where files are, if you can understand the PHP logic it will be much easier for you to know how it all works 8-)

^AJ

4 months ago
25 posts
  • Has been a member for 0-1 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Referred between 1 and 9 users
minimalthemes says


“Where the heck is the HTML !?”

Well, then you have to dig through folders and files and scripts and try to find where that HTML and PHP is being generated and then hope you can figure out how to edit it without blowing anything up.

+1

Personally haven’t purchased a WP theme here for ages (apart from ‘out the box’ solutions) because I really can’t be bothered with the ‘spaghetti’ .

spaghetti? it’s called structured programming

~ewizz

4 months ago
16 posts
  • Has been a member for 2-3 years
  • Bought between 10 and 49 items
avatar12 says

You mention you “are not a developer”, yet you are buying and customizing themes. In which case you pretty much are. If you are always doing this, maybe you need to expand a bit more on your skills instead of spending so much time trying to guess where files are, if you can understand the PHP logic it will be much easier for you to know how it all works 8-)

^AJ

This is probably true – with an expanded skill set I would have less trouble editing these new themes.

But that is kind of my point…

Themes from just a few years ago did not require an expanded skill set. They were more accessible to people of varying levels of programming knowledge. The HTML and PHP were right there in the template files, and you could even edit them via the WP dashboard if you wanted. (Appearance > Editor)

Let’s say you wanted to add or alter a DIV container on your home page, you opened up main index template (index.php) and edited away. That was wildly easy to do.

Now I have to figure out and understand the PHP logic utilized by the author, track down where these DIVs are being generated, and then edit files that are usually buried a few directories deep AND contain all sorts of code unrelated to the template file I care about editing.

That is a significant leap in the complexity of the theme – and thus a significant decrease in the ease of customizing and editing it.

4 months ago
16 posts
  • Has been a member for 2-3 years
  • Bought between 10 and 49 items
avatar12 says

By the way, in case it wasn’t obvious…

I am not suggesting that ALL of the PHP and HTML need reside in the template files. I’ve never worked with a theme that did that. Function calls and includes have always been part of templates… but I felt like they were used for very specialized features or things that required long complex code and would thus obfuscate the template.

The basic structure and outline of the page, however, was always kept in the template.

In contrast, most of the themes I’ve worked with lately have moved everything – including the basic structure of the page – to other files.

I’m looking at a theme right now and the only HTML I see in single.php is a few closing DIVs that obviously shut elements that are opened in the function calls above. Everything else is a call to a function. Literally, the entire structure of the post’s page is buried in function files.

4 months ago
2211 posts
  • Has been a member for 1-2 years
  • Exclusive Author
  • Sold between 1 and 100 dollars
  • Bought between 10 and 49 items
  • United States
OrganicBeeMedia says

if you need simpler themes that are easy to edit buy html or learn some code

the reason why they have got more complex is because they use a server side language to generate the html, the reason theres multiple files is because its not static and most code needs to be in different place to work and function properly

4 months ago
16 posts
  • Has been a member for 2-3 years
  • Bought between 10 and 49 items
avatar12 says

if you need simpler themes that are easy to edit buy html or learn some code the reason why they have got more complex is because they use a server side language to generate the html, the reason theres multiple files is because its not static and most code needs to be in different place to work and function properly

Not sure I understand.

The platform I have in mind, Wordpress, has always used a server side language to generate HTML . This true no matter how you code it out… with HTML in the template files that I am suggesting is more accessible… or with the HTML buried in function files, which I feel is unnecessarily complex.

So I am not sure I see why that would be a reason for this change.

4 months ago
1842 posts
  • Has been a member for 3-4 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 10 and 49 items
  • Europe
  • Referred between 100 and 199 users
digitalimpact says

I’m with avatar12 on this one.

I have no problem in editing/customizing a theme, no matter how complex it is. But it’s sure frustrating to start digging into a new framework for average changes, each time you buy and need to customize a theme.

It’s meant to be a theme, not a freaking kitchen sink. Guess that’s part of the secret recipe people like Orman Clark cooked to be so successful.

From a dev. point of view, I can totally understand something like a loop.php where you do switches based on what loop is needed but man is it frustrating to eat through thousands of lines in such a file.

4 months ago
20 posts
  • Has been a member for 1-2 years
  • Bought between 100 and 499 items
  • United States
beowulf says

I agree, digitalimpact. I also think part of Orman’s success is because it’s much easier to customize those themes. The backend isn’t a crazy hullabaloo framework full of functions, buried files in folders in files in folders in files, etc. That’s why I love developing themes from authors like Orman Clark, Mike McAlister, Jami Gibbs, Peerapong, and a handful of other ‘down to earth’ developers (in my opinion).

4 months ago
by
by
by
by
by