• I’m a (former) WP “newbie” who installed 2.04 a month ago. I’ve been migrating a popular non-blog website (Google Guide) to run as a blog under WordPress. I’ve learned a lot. (I’m a long-time hacker, BTW, so code isn’t scary to me.)

    I keep running into problems that might sound like technical bugs. But I’m starting to think I might be fighting WordPress design decisions — and that maybe WP is the wrong system for us. (American car analogy: is WP a high-end sports car, and what we need is an simple old Jeep?) Here are some examples, then my question.

    The old site uses hand-coded HTML, some ugly, that I’ve carefully cleaned up, then made into XHTML with HTML Tidy, then validated. It’s clean and looks great from our Apache server.

    But getting that nice clean code out of WordPress has been tough. 1) The autop function was causing trouble; I found how to disable it as-needed. 2) The WP system “hangs” repeatably when I pour some code in. 3) HTML like this that I paste into the “classic” editor:

    [&nbsp;<a href="http://www.google.com/search?q=&quot;the+who&quot;" target="_blank">"the who"</a>&nbsp;]

    eventually becomes this:

    [ <a href="http://www.google.com/search?q="the+who"" target="_blank">&amp;#8220;the who&amp;#8221;</a> ]

    and there’s more.

    I’m not looking for a detail answer like “you can fix problem X by editing file Y.” What I’m wondering is whether we’re expecting the wrong things from WordPress.

    We want to serve some clean (sometimes complex) XHTML code exactly as we coded it — but wrapped in the WordPress header, footer, sidebar, comment box, etc. I’m wondering whether WP is intended for something different: to handle all of the sloppy/dangerous/etc. XHTML generated by novices, crackers, and spammers — and make it look good by carefully trying to “fix up” random text to be “beautiful”. [Today, when I found the file wp-includes/default-filters.php, I started to suspect that I’ll never get to my goal: wow, what a lot of (obviously well-designed) complexity!]

    WP philosophers and code architects: am I on a hopeless quest with WordPress? Should I move the complex XHTML code to static pages served directly by Apache — and let WordPress handle other more-interactive pages? Overall advice, please? Thanks!

Viewing 15 replies - 1 through 15 (of 15 total)
  • If this were me, I would do exactly as you’ve stated in your final paragraph – with this caveat: you CAN pull the wp-theming stuff (header, sidebars, footer) into more static pages using the

    <?php require('/path-to-wp/wp-blog-header.php') ?>

    line on files before the DOCTYPE declaration.

    Also – just a note – check to see if (under “Options > Writing”) the line “correct invalidly nested XHTML automatically” is *unchecked*. And make sure your WYSIWYG editor is turned off. That will probably also help out with auto-cleaning of stuff. I have both of those shut off, and every time I code anything, it shows up exactly as I coded it. (And for the record, I, too, *always* comment out the wpautop thing in the default filters file, as well. I can’t stand that.)

    But from a “philosophical” standpoint, I think WordPress can handle anything, really. I’ve done a couple of “static” sites with it – I’m currently working on two that have ZenCart integration, but still keep the “static” appearance. I think WordPress is awesome (and take it from a girl who’s used *lots* of other systems – you name it, I’ve probably used it!)

    Thread Starter jerrypeek

    (@jerrypeek)

    Thanks for making it through my long post, vkaryl and doodlebee. Yes, “correct invalidly nested XHTML automatically” is unchecked, and I didn’t use the WYSIWYG editor to pour the XHTML into WordPress or to edit it later.

    I forgot to say: We’re hoping to have new contributors who are subject-matter experts but not (necessarily) HTML hackers. So it’d be nice to have the “beautifying” features of WordPress for their contributions, but not have WordPress “beautify” my old XHTML.

    Hmm. Interesting then.

    I’ve never used HTML Tidy – I’m a strict Notepad user. “Old school” I guess – I don’t know if HTML Tidy might insert some code (something like Dreamweaver, I think? I don’t know – never used that before either!) or amybe *that* is trying to “fix” your stuff for you?

    All I know is, when I do my think (setup described as above, and I use Notepad to code/edit in and just FTP it to the server) I’ve never had WordPress mess with my code – it always shows up exactly how I coded it.

    Again, though, I know nothing of these programs (Dreamweaver, HTML Tidy) – so I may be completely blowing smoke up the nether-regions – but it might be worth looking into?

    In any case, I’m a WordPress nut, so of course I’m biased and I’m going to tell you WordPress can do anything you want it to 😉

    I’m a wp nut too…. but I don’t believe it’s the be-all and end-all…. I still build “normal” html sites which aren’t static because I use parts of wp on occasion, and I make full use of php includes to pull in stuff that’s going to appear on every page but need changing (or dynamically change depending) frequently.

    In other words, you can really do a lot of stuff without any need for a database-driven program such as wp. Sure, wp makes it easy if you just want people to keep your content fresh for you. But for corporate sites, and some other site implementations, wp is NOT the whole enchilada. It may be a fair part of it (the stripped beef maybe), but there’s a lot more to it than that.

    doo-bee: AFAIK dw has very litte relationship to html tidy – it’s related more to front page. Unless tidy has changed lately, it’s simply a little script that cleans up your html if you’re like some people who just write UGLY code. I have an instance of tidy available through TopStyle Pro (which I HIGHLY recommend as a reasonably priced and VERY accessible css/html editor), and while I don’t use it much, it does what it does extremely well.

    Unlike stuff like dw and fp.

    Good to know 🙂 I’ve just never really had any interest in using programs like that – I did once, a long time ago, but I’ve found it’s much easier to just hand-code. I can find and fix and edit mistakes and stuff so much faster when *I’ve* written it, rather than someone or something else.

    And no, I don’t think it’s the end-all of stuff, but it sure does take the cake (IMO!). One of these days I might do a site that I’ll get stuck on and WordPress can’t handle – but I’ve yet to do one 😉

    Well, case in point: client’s client had a “whizbang” programmer (one of their host’s people) redo the site in wp. Now, first thing is the only perceived need they have for a database is that they wanted some rotating graphics…. Second thing, in his infinite and inventive wisdom, the programmer set up wp so only a very few things are available on the admin side, and locked out any editing unless you use his “specialized” plugins.

    Since the programmer is long gone, and the site is supposedly wp, and I’m normally pretty damn good with wp, I’m sitting here trying to explain to the clients that there’s just NO NEED for all of this backend monkeyshining….

    If a site REQUIRES daily or even weekly content updates, wp is probably a decent fit. Otherwise, what’s the point? All it does is add a totally unneeded layer of complexity (and in cases like my current client one, MANY layers of same, which it can take me up to an hour to dig through to SIMPLY CHANGE A DAMNED LINK TO AN FTP FILE.)

    Needless to say, I’m NEVER selling clients anything they don’t need, like this client paid through the nose for.

    Good point – I know I wouldn’t install WP just because someone wanted a rotating graphic 🙂 I guess it depends on your clientele – most of mine *need* CMS (which I love to use WP for), but my *real* client base is bloggers. So I guess that’s why I like it so much – all my clients actually need it!

    So putting this together with the original question – I’d say it would actually depend on what it is that you *do* want the site to do. Looking at the site you’ve mentioned, I’d say maybe WP *isn’t* what you need. I see a lot of static pages that don’t really need a lot of content management. I would think this thing could be done with simple PHP includes (for stuff that *doesn’t* change – like naviagtion, header information, footers, etc. – or you’d like to just change one file and have it change site-wide) and static pages. So maybe WordPress is a bit more “sports car” than “Jeep”? 🙂

    I mean, unless you plan to actually have some dynamic content in there, and have a need for preventing someone from messing up the “template” when they enter content, then no – I would think that you could go straight php includes and static pages with no worries. But if you just want the ability to update or add new content (without worrying about someone inadvertently messing up the template), and maybe have some neat dynamic things happening, then sure – WP can easily be used for this.

    Thread Starter jerrypeek

    (@jerrypeek)

    I think we might want some combination of 1) a CMS for more-dynamic content (we do want to have more contributors and “action” on the site) plus 2) the existing (cleaned-up) static XHTML pages with PHP includes to pull in stuff that’s going to appear on every page. I’ll experiment with that, thanks vkaryl! (If you have a more complete example, that’d help: when I’ve tried to insert PHP code in my WordPress pages, the server doesn’t interpret it; I just see the PHP when I do “view source” on my browser. I guess I need to make pages named foo.php with some WordPress PHP calls in them…)

    doodlebee, how do you upload content into WordPress with FTP?? I’ve been searching for that info since Day 1. (I also have SSH access to the server files, and I can run MySQL commands. I’m just not very familiar, and I haven’t found a straightforward “howto”.) Even the “classic” editor — or some code it runs — has been doing some of the link-munching. If I could eliminate that variable from the WP system, I might be closer to the system we need.

    Your comments are a real help! (More thoughts about my original question, anyone else?)

    Hi Jerry –

    Generally, I insert “normal” php calls using something like this:
    <?php include 'menu.html' ?>

    I’ve never really had any trouble with it working that way. You can’t use the wp specific construct <?php get_* ?>

    Thread Starter jerrypeek

    (@jerrypeek)

    Hmmm, vkaryl… our sidebar has a lot of calls to functions from plugins and from WP itself, like series_table_of_contents() and wp_list_pages(). If we don’t have WordPress functionality on the static XHTML pages, those pages could feel different to visitors than the dynamic pages running under WP. Also, I guess that the WP “search” functionality wouldn’t work on the static pages.

    Are those kinds of things a problem on your sites — and, if they are, do you have ways to work around them?

    how do you upload content into WordPress with FTP??

    You don’t. I was saying editing *files* and uploading them. You can’t upload content with FTP because all of your posts and content reside in your database – they are not files on the server.

    when I’ve tried to insert PHP code in my WordPress pages, the server doesn’t interpret it

    You could use a plugin like “runPHP” to run PHP within your content area. However, if you want to use PHP or include your sidebar, footer and header form WordPress into your static plages (that are outside of WordPress) you can add “wp-bog-header” include to your pages. For example, I have a contact form that’s outside of WordPress, however I want to include everything so I dont’ have to change those files separately should something else within the site change. Before *any* code starts on that file, I insert the line:

    <?php include("/home/sitename/public_html/wordpress/wp-blog-header.php"); ?>

    (You have to use the correct path for your server though – this path may not be the one for your site. You have to go to your host to find out what the correct path is from the server’s root.)

    Then I put in my get_header() and everything to include the WP stuff.

    Saerch functionality won’t work on rgular static pages not residing within the WP database. However, you can create Pages within WordPress that *can* be included in the search with a plugin. You can also give static pages a “different look and feel” and still have them reside in your WordPress database by using conditionals.

    Does that get you a little further?

    Thread Starter jerrypeek

    (@jerrypeek)

    Thanx again, doodlebee. This is all really helpful — especially the tip about wp-blog-header.php. But I just realized that if I don’t put content in the WP database, it’s not only the search that won’t work. Our “email this” plugin won’t work. And more. So I think I should keep fighting this out with WordPress 🙁 for now.

    I just thought of another way. The server freezing and link reformatting seemed to happen in the WP “classic” editor (the inline-uploading.php and execute-pings.php scripts hang on the server; I can see that by running ps). For the complex pages with those problems, if I can bypass the editor and put content straight into the WP database, that’d be at least half the battle.

    For instance, I might create the Post from the editor with everything except its content, then open the database post_content field through PHPMyAdmin and paste the HTML there. I’d have to escape the doublequotes (turn each " into \"), but that’s easy.

    If this idea sounds dangerous, please warn me off. 😉 Otherwise I think I’ll try it on our development site.

    Well…. try it on your dev site – AFTER you make redundant backups of the database!

    I’m not averse to dinking around in my databases at all…. but I wouldn’t do what you’re thinking about doing – because it’s likely that wp will choke and die on it at some point….

    Thread Starter jerrypeek

    (@jerrypeek)

    Will do, vkaryl — backups before I do any serious editing, I mean. Right now I’m just trying to get a dev site working, to be sure WordPress will work for us.

    I pasted one long tricky HTML page into PQPMyAdmin last night — one of the pages that freezes the server when I try to paste it in via the WP “classic” editor — and it worked great. Now the page looks fine in my browser, and it validates too.

    Yesterday I found a support thread http://ww.wp.xz.cn/support/topic/20768 about using MT Import to copy content into WordPress. It’s pretty old, so I don’t know if it will work. But I might try it too.

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

The topic ‘Is WordPress wrong for us? (Calling WP “philosophers”)’ is closed to new replies.