dumb wordpress questine

  • Started
  • Last post
  • 26 Responses
  • ukit20

    Well you shouldn't need to make a different template for every page unless the design is different. Usually you would include some code like this to pull the content of your page:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php the_content(); ?>
    <?php endwhile; endif; ?>

    It's true that they don't give you a place to enter sidebar content for each page. You would have to use a plugin to add that kind of functionality. Something like this would work: http://wordpress.org/plugins/adv…

    • that's what i thought - thanks for all your help. it seems a shame something so simple is so hard to do in WPhans_glib
    • Yeah I guess the typical WP model is to have the same sidebar on every page.ukit2
    • gawd, that plugin is for serious codeheads... way beyond me I fearhans_glib
  • hans_glib0

    Cheers for that, though I guess I'll have to make a new template for very page... clunky.

    Next question - the content area for all the other pages has a main column div and a side column div. The text in both columns changes from page to page - is there a way of setting up a template for this? The page creation in WP seems to allow for only a single column - if I paste the html into the "create page" text area, it just comes out as a single column...

  • ukit20

    OK I see your problem...WordPress doesn't call the PHP templates directly, if it did it wouldn't be much of a CMS would it? What you want to do is, in your donate.php file, add some text at the top of the file like this:

    <?php /* Template Name: Donate */ ?>

    Then go into the WordPress admin and create a page, and for that page select the template "Donate." When you view the page, it should contain whatever is in the donate.php file.

    • by god, that works! cheershans_glib
    • though it's not very handy if anyone but me wants to edit it.hans_glib
    • That's where Custom fields come in. Replace the static content in the layout file with custom field calls and register those custom fields to that page layout.orrinward2
    • custom fields to the page layout, then people can edit the content by editing that page.orrinward2
  • hans_glib0

    ^
    this is what i don't understand. i've taken the content from "donate.html" and made a file called "donate.php" that calls "header.php" then has the html content, then calls "footer.php"

    But if I try to access that page "http://localhost/wordpress/dona...
    I just get a 404

  • ukit20

    The problem may be that donate.php is not actually linked to the page you are loading. Unless a specific template is selected for each page, it will display page.php by default.

  • ukit20

    Just check which template file is being called and look at what is in the file (i.e. donate.php or whatever it is). Wwhatever code is contained in that file is what will be displayed.

  • hans_glib

    i cannot codding properly so please to help

    Is there any way of adapting html pages into Wordpress without chopping them up to fit the content/sidebar structure? I'm trying to put a pretty straightforward site together(for a charity, so no money) and while building it in html is pretty straightforward, trying to make it work in WP is doing my head in.

    I was hoping to import the static html pages as they are, and just use the bloggy bit of WP for news items. But WP isn't playing nice, mainly I suspect as I'm trying to circumvent the database element.

    I've split out the "header.php" and "footer.php" and I can get it to build the home page by simply recreating the content of "index.html" in "home.php". But why won't it let me do this for other pages (say donate.php)?

    Is there a way round this?