Word-Pressed PHP (technical)
14 years ago
I thought I'd just tell you folks what's going on since I vanished back into Dark Code Forest. I know a lot of you are far better programmers than I am, so I dunno -- maybe you can direct me toward resources that allowed you to do something similar to what I'm attempting. Or, maybe what I'm asking for is crazy impossible.
To put it briefly, like most programs Wordpress has turned out to be smart enough to "help" me in ways I don't want or need, and too dumb to do the simply-conceived useful things I'd like it to. My hand-coded HTML pages with CSS buttons which work and behave perfectly when uploaded separately are completely unsuitable for use in a Wordpress environment.
I'm using the Addon Webcomic (http://mgsisk.com/webcomicms.net/) to control uploads. I'm very pleased with Webcomic; as a content management system it's excellent. My problems are nearly all at the Theme level, and it doesn't seem to matter much what theme I'm using. (I'm currently attempting to use the Inkblot theme, which is one of the approved Webcomic themes. The other is Archimedes. They're both linked from the Webcomic site.)
My initial goal is to create a static front page with some dynamic content. What I want is basically a few static buttons, and some fields which contain previews of the latest posts -- small preview images of the latest comic and gallery uploads, and the latest blog post. (The preview images are generated automatically on upload and can be called using PHP.) This is proving very, very difficult.
Firstly, I'm having a problem overriding enough of whatever Theme I'm using. My HTML and CSS is being crippled by the theme parameters, and I really need Inkblot or Archimedes running to run the rest of the site. But for my static pages, I'd just as soon turn off all the formatting (especially the ubiquitous 'wrap' field it draws down the middle of each page). I've created some custom PHP Template Pages to see what I can do about it but so far it's slow going. The Theme rules all.
Worse, I've been unable to find any way of easily embedding PHP content in a static page's layout. The PHP call is installed on a Template, but I can't find any way that the content could be set to load into a particular field of the static page on the HTML section.
Anyway, I've gone through two good instructional books (one on Wordpress and one on XHTML and CSS) and a fair chunk of the Wordpress Codex, watched hours of the Webcomic training videos (many of which are now hilariously out of date since they changed their code substantially with the last update, which was after they did the videos), and spent hours just playing with Wordpress itself according to the Codex tutorials. I went through a bunch of the purported PHP solutions like Exec-PHP, which do various backflips to make in-post PHP activate, and they didn't really seem like much use.
So now it's down to figuring out if I can do layout in PHP, which seems like it would be nightmarish, or finding some better examples, or throwing out an idea it seemed like Wordpress was made to do as completely unworkable.
For those of you who've read this far, there's a sample of the dummy layout I was working from at http://www.joerosales.com/SAMPLEfrontpage01css.htm . Yes, it uses internal CSS since it's just the dummy. Sure is pretty, isn't it? Wordpress despises it. As a static page I can't even reproduce the table, let alone get the nav bars running.
Anyone have any helpful resources toward my goals I may not have seen yet? Or coding suggestions to make Wordpress stop beating up on my left hemisphere?
To put it briefly, like most programs Wordpress has turned out to be smart enough to "help" me in ways I don't want or need, and too dumb to do the simply-conceived useful things I'd like it to. My hand-coded HTML pages with CSS buttons which work and behave perfectly when uploaded separately are completely unsuitable for use in a Wordpress environment.
I'm using the Addon Webcomic (http://mgsisk.com/webcomicms.net/) to control uploads. I'm very pleased with Webcomic; as a content management system it's excellent. My problems are nearly all at the Theme level, and it doesn't seem to matter much what theme I'm using. (I'm currently attempting to use the Inkblot theme, which is one of the approved Webcomic themes. The other is Archimedes. They're both linked from the Webcomic site.)
My initial goal is to create a static front page with some dynamic content. What I want is basically a few static buttons, and some fields which contain previews of the latest posts -- small preview images of the latest comic and gallery uploads, and the latest blog post. (The preview images are generated automatically on upload and can be called using PHP.) This is proving very, very difficult.
Firstly, I'm having a problem overriding enough of whatever Theme I'm using. My HTML and CSS is being crippled by the theme parameters, and I really need Inkblot or Archimedes running to run the rest of the site. But for my static pages, I'd just as soon turn off all the formatting (especially the ubiquitous 'wrap' field it draws down the middle of each page). I've created some custom PHP Template Pages to see what I can do about it but so far it's slow going. The Theme rules all.
Worse, I've been unable to find any way of easily embedding PHP content in a static page's layout. The PHP call is installed on a Template, but I can't find any way that the content could be set to load into a particular field of the static page on the HTML section.
Anyway, I've gone through two good instructional books (one on Wordpress and one on XHTML and CSS) and a fair chunk of the Wordpress Codex, watched hours of the Webcomic training videos (many of which are now hilariously out of date since they changed their code substantially with the last update, which was after they did the videos), and spent hours just playing with Wordpress itself according to the Codex tutorials. I went through a bunch of the purported PHP solutions like Exec-PHP, which do various backflips to make in-post PHP activate, and they didn't really seem like much use.
So now it's down to figuring out if I can do layout in PHP, which seems like it would be nightmarish, or finding some better examples, or throwing out an idea it seemed like Wordpress was made to do as completely unworkable.
For those of you who've read this far, there's a sample of the dummy layout I was working from at http://www.joerosales.com/SAMPLEfrontpage01css.htm . Yes, it uses internal CSS since it's just the dummy. Sure is pretty, isn't it? Wordpress despises it. As a static page I can't even reproduce the table, let alone get the nav bars running.
Anyone have any helpful resources toward my goals I may not have seen yet? Or coding suggestions to make Wordpress stop beating up on my left hemisphere?
I despise them all, which is why I code directly in HTML, PHP and Perl.
Which doesn't answer your question. I still don't quite fully grasp what you're trying to do. But, based on your general description and my past experience, what you want done should be do-able. I've gotten PHP code snippets to update page data in other CMS's (like the room reservation system I developed for the school where I work). But in your specific case it may require a knowledge of Wordpress that I simply don't possess. But I'll be happy to help out in any way that I can.
What you need to know about CMSes is that they are designed for people who want plug-n-play solutions, so you're not going to get much in the way of customization. It can be difficult, which is why I elected to code my own comic strip system which uses flat files for updates.
The Wordpress template system is actually quite straightforward, though the organization leaves a great deal to be desired. You need to track down which template has the entry point you want, and then you can just paste a link to your custom template in there. That requires you to use one line to the template (hopefully FA won't barf on this code):
<?php include(TEMPLATEPATH . '/custom.php') ?>
You can then put any HTML or PHP code you want in that file. HTML is written exactly, PHP must have the "<?php" and "?>" tags surrounding it. Once you know where to put your custom hooks, getting the preview images and stuff should be easy.
As for the CSS, that's a different monster.
There's a great tutorial on writing child themes here -> http://op111.net/53/
DOCs on child themes from WordPress -> http://codex.wordpress.org/Child_Themes
As for the static front page, that is also easily done inside of WordPress itself and you can find info about it here -> http://codex.wordpress.org/Creating.....tic_Front_Page
hope this helps.
The Front Page uses a somewhat specialized template, but it still adopts all the formatting written into the Header, and thus all the formatting of the theme itself, which is overriding my code. The Front Page is simply a pointer that Wordpress directs toward a certain post, at which point that post becomes the Front Page. For now I'm using a stripped PHP Template to test the page I want to use, because I had this crazy idea of getting that page working before I put it up as the entry to my site.
I've already gone through several tutorials on static pages and front pages to see if they could tell me anything new, but most have even less than in my reference books. Creating static pages and child themes are easy. My problem is in overriding the Theme formatting and loading PHP into static fields.
From the dummy layout you posted - it looks no different than any other front end WordPress dynamic page. Can I assume that the difficulty lies in that you don't want the comics showing on the front page short of the latest comic thumbnail (and both it and the latest gallery thumb should be dynamic as well)? Or are you wanting to get rid of sidebars? Or only show one blog entry of a certain category?
There are a couple of ways I can think of to handle any of the above - either create a new 'Page' (which is good, old-fashioned html that loads inside of the Theme), or create a custom page template which is a pain in the ass but allows for more complex dynamic handling of data.
If it's the image with the writing and gallery and connect buttons - that can be achieved via a simple widget placed in the right place. If it's more due to not wanting certain widgets to show, there's ways to define what widget shows on what pages.
If all else fails - making sure that you have different calls on the different page-types insure that you they won't X-talk. IE if WordPress calls $background, make sure the other page calls $front_background or something along those lines. Same goes for CSS calls. Right now they seem to be sharing a name structure and that's always bad news, when you are trying to do separate things.