Forums

Theme Authors Adding Modules (24 posts)

  1. Lorelle
    Member
    Posted 7 years ago #

    I thought to myself, "hey, you're having all these problems with your layout, just do as you advise others and find a theme that matches the look you want and then modify it to be your own." This is all good, but there are Theme Authors out there who are adding modules and changing some basic structure things and I'm confused.

    Kubrick calls for the header and then has the Loop in the index.php which allows you to modify if you want to see the whole post in the main page or an excerpt in an IF/ELSE statement. When you click on the link to the post, it calls upon the IF/ELSE statement to show the single.php with the post.

    In another theme I'm looking at, it doesn't seem to allow you to do an excerpt at all, just the whole post. So I think it will be easy to just change the Loop. No doing. There isn't a "Loop" as I'm used to seeing in Kubrick and others. It just calls for the post.php file, something new to me, and then does stuff from there. I thought this might replace the single.php, but it doesn't.

    Let's see if I can explain it right. The index lists this:

    <?php if ($posts) { ?>
    <?php foreach ($posts as $post) : start_wp(); ?>
    <?php require('post.php');?>
    <?php endforeach; ?>

    There is no option for single.php or excerpt because there is no <?php the_content(); ?>. That sits in the post.php but there is no clear loop with options other than "if it ain't there, go to page not found".

    The single.php looks like the index.php, with all the doctype, head info and everything, but it also features the require post.php.

    Where did the Loop go that includes the content?

    Now, I'm not saying that this author is right or wrong. I just want to know where the parts and pieces are.

    The template I'm referring to that has the different structure is No Limits.

  2. Kafkaesqui
    Moderator
    Posted 7 years ago #

    <?php require("post.php");?>

    This is, in effect, your internal portion of The Loop for this theme. The option for single.php is still there. To allow for a different configuration of The Loop in the various post page types, such as display excerpts in category and archive listings, or change the title from a link to straight text, you'll have to go into post.php and add if/else statements to test for these (is_category(), is_archive(), is_single(), etc.). Or you can replace the require to post.php in each template with The Loop internals set up as you desire.

    Anyway, there are no official guidelines for how to go about setting up a theme, and I'm certainly not passing any judgement on the choices made, but some of the structural logic in this one do go a little outside the expected. For example, looking at index.php, single.php, category.php and so on, I wonder why the <head> portion is duplicated in each, instead of residing in header.php (a mere 3 lines). But, we all have our reasons.

  3. Lorelle
    Member
    Posted 7 years ago #

    So the if/else statement should be in the post.php in this case. Goodness, it's a little confusing since I would expect the post.php to be "the" post instead of single. But I can't find a reference to "single.php" in the code. I've posted a note on the author's site, but they are having major problems with their comments, returning a 404. I'll put the loop I have from my original theme into the post and see what happens from there.

    I'm not passing judgement either, it's just that I thought I had most of the loop figured out and now it's different with a different theme...so much to learn.;

    Thanks.

  4. Kafkaesqui
    Moderator
    Posted 7 years ago #

    Note that reference to single.php is not required within a theme. If a single.php file resides in a theme's folder, WordPress will use it automatically for single post pages; if not, it uses index.php.

    See Ryan's post here for informational links:

    http://wordpress.org/support/topic.php?id=25202#post-142088

  5. sadish
    Member
    Posted 7 years ago #

    I know you guys are talking about one of my themes.

    I idea behind the post.php, is that it holds all the xhtml for how to display each post.

    I usually play with how a post's data are organized.
    each post has the following elements.

    1. post-title
    2. post-date
    3. post-time
    4. post-categories
    5. post-content / excerpt
    6. Author name
    7. a link to comments.

    before releasing a new theme, I usually play with different options of arranging these 7 ingradients of a post.

    So I preferred to move it to a separate file, and include it from index.php, category.php and so on.

    so if i want to display the authorname, just below the post-title, then I would change it only in this file. and all others will pick up the changes.

    Thats the whole idea, but again, choices differ.

    Thanks for the understanding.

  6. Root
    Member
    Posted 7 years ago #

    As a community I would say that we are only just getting started on this. I have rewritten all my files from the ground up before I even got started on the theme itself. What I see is a lot of creativity in this area - there is no need to think that what we start with is the best or most convenient way to go. It does make editing third party themes more difficult - I agree. Speaking personally - and other theme builders may have different preferences - I think the if / else malarkey is unnecessary and leads to confusion. But that is just my 2c.

  7. webwide
    Member
    Posted 7 years ago #

    This may be out of place on this thread, but I noticed that one particular theme, CleanBreeze, adds built-in support for several plugins. This seems to go beyond a Theme and it seems to me that the "built-in plugin support" ought to be more of a feature for WordPress itself. Maybe the project needs some guidance here?

    http://chris.coggburn.us/cleanbreeze/

  8. Lorelle
    Member
    Posted 7 years ago #

    Kubrick also features some plugins, that are available if you want them. Should there be some rules that say plugins should or shouldn't be included? If the Theme isn't part of a contest, why not? I just started using Firefox and I choose a "skin" that had some plugins (extensions) installed so I didn't have to. Since I was unfamiliar with Firefox and all the bells and whistles, I got some bells and whistles by introduction. Once I understood those, I started hunting for more.

    I don't know if there should be rules, but if a Theme does include plugins as part of their set, I do feel personally that a "user-beware" notice of explanation should be included. It might be an incentive to use that Theme.

  9. Kafkaesqui
    Moderator
    Posted 7 years ago #

    "I don't know if there should be rules."

    And who, exactly, enforces these rules? The WordPolice?

    :/

  10. Root
    Member
    Posted 7 years ago #

    Lorelle to be frank - as always - I am not sure the language of rules is right for this forum. People are going to ship their themes any which way. And why not. ?

  11. Lorelle
    Member
    Posted 7 years ago #

    Wow, sensitive folks. Here I was defending people right to do whatever the heck they want with their themes and now I'm being accused of starting a need for the WordPolice?

    Come on, folks. Lighten up.

  12. Kafkaesqui
    Moderator
    Posted 7 years ago #

    Hey, I used a smiley. How much lighter do you want?

  13. vkaryl
    Member
    Posted 7 years ago #

    Well, hmmm. No one asked me, but.... if what one is doing is producing a theme for one's own space, then it shouldn't matter at all how one arranges the "pieces parts". BUT. If one is producing a theme for "public consumption", I think one should be required to follow some "standard construction policies" before one's theme(s) are given some stamp of approval (such as inclusion in the theme competition or whatever).

    In other words, if one wants other people to use a theme, how about using either the classic or default as a base, so that stuff is found in the same relative "places". In most ways that would make the "theming life" a whole lot easier - especially for people like me who have very little basis in coding of any sort, and who can manage to figure out how to change a redirect to wp-admin/ to somewhere more logical without breaking something, but that's about all....

  14. moshu
    Member
    Posted 7 years ago #

    Well, the competition has some rules.
    On the other hand releasing a theme not for the competition, but... hmmm, let's say, just for fun and enjoyment - shouldn't involve any kind of rules. If it is well done, it will work. If not, people will dump it.
    Of course, friendly comments and/or a readme file could help the users.

  15. vkaryl
    Member
    Posted 7 years ago #

    I guess I think that even for "fun" one shouldn't publicly release something that needs detailed readmes or is likely to cause the user, when wishing to do a simple tweak, to say "what on earth is going on here!"

    Really, a set of standards shouldn't be too difficult to adhere to if one is competent with CSS, php, and html. [Hrmm. Well, for me, 2 out of 3 isn't bad I suppose....] Consider, part of the reason that people are always posting situational difficulties not only here but many other support fora has to do with the fact that IE does NOT adhere to standards.

    I feel it's the same thing. If wp and its users want IE to adhere to standards, then people who develop for wp should have standards to which they adhere as well.

  16. Kafkaesqui
    Moderator
    Posted 7 years ago #

    Hey, maybe we can test them?

    How about a certification process?

    Licensing, anyone?

    I understand the desire to get designers, plugin writers, and anyone else who can be dropped in the category of developer, to follow some basic standards before putting their work out there. But we're not talking about Microsoft or the Mozilla development team sending off a piece of software that may end up in the hands of literally a hundred million users.

    WordPress, perhaps. But that's a different topic.

    In many, many cases it's a fellow user putting something together because it's educational for them, or solves a problem, or provides a chance to give back to the community. Or, yes, fun. Many don't have thousands of hours of programming experience, or spent the last decade designing web sites, or sport a BA in the computer sciences. Through trial and error, personal sweat and tears, and perhaps a bit of luck, these "developers" come up with something that could be of use to others, and through their own impetus or from urging of friends and other WordPress users choose to make it public.

    You want these folk to adhere to a set of standards? Encourage them to practice good coding and design methods. Ask them to include a readme file or comment their code. Even better, offer to help them in these efforts if you can, to test their work, or write the user documentation. You may be surprised at the number who don't because they feel they lack the ability. The solution to a derth in standards is to become part of the community and get involved in making others understand the reasons for employing them, and not simply lamenting the shortage thereof.

    When that happens, the support forums may see less traffic from these "situational" issues, but it will also see an increase in users wanting to do even more with WordPress. And that's the point.

  17. Root
    Member
    Posted 7 years ago #

    And ideally to do it by the personal example of the code you unleash on the community. Not by preaching.

  18. Jinsan
    Member
    Posted 7 years ago #

    I think Kaf and Root have summed it up for me, as someone who doesn't know his id from his class (ok I lie, I know) I am always in the process of learning and I can only learn from what others offer for knowledge. If there are examples of themes to adhere to, in terms of coding and structure then point them out. I've tried messing around with Manji at first, but found it difficult because I didn't understand anything of what I was doing. Having worked with simpler themes, I understand it better and feel I can make a better example than my previous efforts.

    Kubrick on the other hand I find much more difficult, this I would say is not one of the better examples. Don't shoot me down here, I'm just saying as someone who's learning and trying to understand, Kubrick does things quite differently some of which confuses me at times, where as other themes seem to follow a more structured, and generic flow where learning the theme and understanding the css is a much more rewarding experience.

    One of the best examples is probably the original WP theme which has been "relegated" to classic status rather than default. It's nice to have an out of the box site that looks great immediately, but when it comes to messing with it, it's hard work and there aren't any guides on how to do it (unlike Podz excellent classic tutorial).

    If you have knowledge or information to share, pointers to make and standards you wish others to implement lead by example and teach others. If you decide it's easier to preach and not teach, you won't encourage anyone to follow any example but their own.

    What I liked about the Your WordPress area is that people are kind enough to actually check the validation for your site! This is has become almost instinctive for many userz to check the validation of a site before commmenting. I don't know if this is down to being pedantic, or simply trying to help, either way this sort of encouragement and pointer is invaluable to helping users understand why validating and managing their code will help ease any questions they will receive on why x doesn't work when you change y.

  19. notthatugly
    Member
    Posted 7 years ago #

    As a theme developer, I absolutely reserve the right to make themes that are based neither on Kubrick nor Classic, and to innovate in terms of which templates I include and how I structure them. Otherwise I might as well just stick to stylesheets.

    As for plugins, if the designer is willing to deal with the extra support requests their inclusion will draw, why not? I can easily see why a theme author might want to use something like Image Headlines or Recent Comments, and I don't really see anything wrong with that as long as they provide adequate documentation.

  20. Lorelle
    Member
    Posted 7 years ago #

    Okay, so tell me this, IF someone includes plugins in their theme, does the theme automatically "plug them in" or does/should the documentation clearly state that the user has to plug these in if they want the plugins to work.

    And what if they don't? When there is plugin code inside of my files and the plugin isn't activated, I often get all kinds of errors. I'm curious how those who want to offer up plugins as part of their Themes deal with these issues. It might help others who want to include them.

  21. TechGnome
    Moderator
    Posted 7 years ago #

    That's poor planning on the part of the theme developer/designer/coder. There's a simple funciton in PHP, I think it's called function_found() and you pass it the name of a function (presumably in this case the plugin's function) and it returns True if the funciton is found (plugin installed and activated) or False if it is not (plugin in not installed and/or activated). Then and only then should the plugin be called. It's just me, but I personaly think that's the best way to go. Especialy if you plan to release it on the unsuspecting public at large. And it can also save your own sanity at a later time when (for what ever reason) you need to turn off a plugin.

    Tg

  22. Root
    Member
    Posted 7 years ago #

    Certainly - I agree with Tech. Including a plug in is only as hazardous as insatalling it in isolation. Yes it needs coding properly. Yes it needs instructions. Yes it needs - hopefully - the user to follow them. I would hazard a guess that themes with plugins are going to big in WP. There are good reasons for that.

  23. Gillie2tat
    Member
    Posted 7 years ago #

    So - for someone who is just getting their teeth into php and knows a bit of CSS and who knows HTML really well, where would you people suggest the best place is to start if you want to learn how to design themes and there are no standard guidelines in the way that you get when you start HTML with things to do and not to do? Is the best way to learn how to design themes just starting to hack into the code and play around with it? I'm also wondering now that I have a much better idea of how the php files work together whether it's a good idea to start learning to use php.

  24. Root
    Member
    Posted 7 years ago #

    I am beginning to visualise this as 3 levels. We can do style sheet only designs, we can do new templates or we can rewrite the core php files in themes. There are a lot of good resources but where to get started ? Heck just start doing what you like doing. Good luck and welcome.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.