Why WordPress theming sucks
yop.la
yop.la
#2) True, and I agree. The function naming could be improved. If you don't know what the function does, look it up in the codex or the source code. The documentation could improve, too, but one of the stated goals for their next development period is improved docs.
#3) Look at the docs. Yes, the_title() writes to the page. If you want to use the title in a variable, there is get_the_title(). There are generally other functions or parameters you can do if you want it to return the value rather than writing it.
#4) False. The comments template file is comments.php.
#5) True.
Actually, within The Loop, you would us the_title('','',false)
http://codex.wordpress.org/Function_Reference/get_search_for...
So what, don't have I the right to bitch around WP naming for functions?
We use Twig as a templating language and expose our entire data API so there isn't a massive set of functions to learn. Here is an example of how to list the latest posts:
<ul>
{% for post in hifi.get({'type':'post','orderBy':'-publishedAt'}) %}
<li>{{ post.title }}</li>
{% endfor %}
</ul>
This keeps the process of creating a theme mostly about HTML/CSS because it dramatically reduces the specific information that you need to know about the platform itself.This almost happens to me all the time but I know better. I spend 10 minutes with a new program, decide it's batshit crazy but instead of posting a lame article I have the wisdom and experience to stop and tell myself "I'm just a noob" and will probably embarrass myself.
However, I can't believe none of the WordPress developers has never suggested to rewrite it using nowadays technologies?
I'd be willing to help out if anyone here is brave enough to try a rewrite!
Separating the design from the code would make it a lot easier for designers to create themes without having to worry about PHP. A proper templating system like Smarty would make a huge improvement with its built-in modifiers. For example:
<?php
$title = the_title( "<h1>", "</h1>", true );
if(strlen($title > 80) {
echo(substr($title, 0,80)."...");
}
?>
Would be this if Wordpress used Smarty: <h1>{{$TITLE|truncate}}</h1>
This makes any display logic in the templates more portable when switching themes as well, because designers will be less prone to putting that code in header.php or single.php.In the process of adding a templating system to Wordpress you would come across many instances where you'd wish that instead of having to bother with structures like:
<?php
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
...add posts to an array, then assign to template...
The developers had just used an object model that let you do something like: $smarty->assign('POSTS',Post::getRecent(10));
And then access them in the template like this: {{foreach from=$POSTS item=post name=posts}}
<h2>{{$post->title|truncate}}</h2>
<p>{{$post->content}}</p>
{{$post->url->permalink}}
{{/foreach}}Anyway PHP is itself designed as a Templating language and works very well.
Adding Smarty or any other templating language into the mix just means that users and developers have to learn both PHP and the templating language.
http://wordpress.org/news/2010/07/eol-for-php4-and-mysql4/
It doesn't need a rewrite. Instead, work with the many brilliant devs who have been improving it for years and know it inside-and-out -- including its flaws and areas for improvement.
The only reason they are abandoning PHP4 because it has become so rare they can't test against it anymore, not because they want to improve anything. Remember this crap: http://ma.tt/2007/07/on-php/ ?
Which is typical for WordPress: one of the most successful companies to be built on PHP, and all they do is bitch about it and use their influence on a part of the community to hold it back instead of contributing, like Facebook, Digg and such.
Source: http://wordpress.org/extend/
I'd call the API a success: it has thousands of authors releasing thousands of plugins and themes and this is only the code that's been released open-source.
Just because it doesn't look like how you envisage it should doesn't mean it doesn't exist.
Matt's post was true at the time and WordPress.org the open source project has never been "holding back the php community". Instead we have been ensuring that the most important people, our users, are able to upgrade reliably and easily on whatever hosting platform they use.
In the end we put the users first because without them the project would just wither away!
They started a while back on doing pretty much just that.
Is WordPress the way to go these days for blogging?
How does it compare to Blogger? What other reasonable options are there, and how do they compare?
Edit: And how does it compare to posterous?
I think there are differences to consider between hosted blogs and blog scripts you can actually install on your own server and customise the way you want.
Am I right?
blogger is...
- easy to setup
- hard to customize
- limited in terms of features / plugins (if any)
- hosted as a service