dumb wordpress questine
- Started
- Last post
- 26 Responses
- hans_glib0
you sir are genius - that works a treat.
thx so much, now to sort the layout...
- hans_glib0
<!--bump-->
- 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.
- 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.
- 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
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
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
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…
- hans_glib0
ukit2 you are a genius - thank you so much.
amazingly i managed to get the plugin to work - sorted!
qbn to the rescue again
- hans_glib0
yes but the problem is the thumbnail is supposed to go into the attachment-custom_thumb div, and it isn't. I don't understand the code to know why it's not happening
- Xopher0
You could just use a plugin if you're not up to speed.
This one pulls the recent posts and lets you include the featured image, post excerpt etc...
- hans_glib0
hey presto ukit, strikes again. I scoured t'interwebz looking for a basic how-to but they either are too simple or too complex.
thank you sir.
- hans_glib0
The problem is that WP is arranging the excerpt so:
<h3>headline</h3>
<div class="thumbnail pic"></div>
<p> excerpt </p>and i need it to arrange it like this:
<div class="thumbnail pic"></div>
<h3>headline</h3>
<p> excerpt </p>and I can't see anywhere in the coding that will allow this
sorry to keep on at this, but it's so frustrating!
- Nathan_Adams0
You don't have to go through the <?php /* Template Name: Donate */ ?> and then select the template routine.
If you name a file page-xxxxx.php, then it will get used by default by any page titled xxxxx. So create page-donate.php, upload it, and that's your Donate page taken care of.
- can it then be edited within wordpress?hans_glib
- if you still have your template tags in it, then yes. It's just an alternative way of doing page templates.Nathan_Adams
- ESKEMA0
please post the code in something like paste bin, code pen or jsfiddle, it's a lot easier for people to help, without having to retype everything.
- ESKEMA0
the thing I see here is that you are using a technique to get image into the excerpts, but then you want them out of it.. Not the best approach.
I would use Advanced Custom Fields to create an Image Field and assign it to posts or whatever.. then just output it before that code you have above...
- ESKEMA0
here's an output for an image field (ID)
http://pastebin.com/bbqLyhNV- will WP see this as the place to put the thumbnail for each excerpt? (ie repeat the field for each excerpt)hans_glib