• 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.

Viewing 15 replies - 1 through 15 (of 23 total)
  • <?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.

    Thread Starter Lorelle

    (@lorelle)

    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.

    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

    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.

    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.

    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/

    Thread Starter Lorelle

    (@lorelle)

    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.

    “I don’t know if there should be rules.”

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

    :/

    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. ?

    Thread Starter Lorelle

    (@lorelle)

    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.

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

    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….

    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.

    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.

    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.

Viewing 15 replies - 1 through 15 (of 23 total)

The topic ‘Theme Authors Adding Modules’ is closed to new replies.