Personal Development for Smart People Forums

Personal Development for Smart PeopleTM Forums


Go Back   Personal Development for Smart People Forums > Personal Development > Technology & Technical Skills
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Technology & Technical Skills Computer skills, hardware, software, internet topics, gadgets, programming


Welcome to the Personal Development for Smart People Forums, the place for lively, intelligent discussion of all personal growth issues -- physical, mental, financial, social, emotional, spiritual, and more.

You're currently viewing as a guest, which gives you limited read-only access. By joining our free community, you'll be able to post your own messages, access many members-only features, see the new messages posted since your last visit, and of course remove this header message. Registration is fast, simple, and free, so please join today.

If you arrived here from a search engine, you may want to explore the main site first, which includes hundreds of deep and insightful articles on a variety of personal development topics.
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-15-2008, 06:14 PM
Senior Member
 
Join Date: Jan 2007
Location: The Netherlands
Posts: 1,647
JimOfferman is on a distinguished road
Default WordPress: Templates & Custom Fields

Does anyone here know if the following is possible and, if so, how to set it up:

Let's say I have a page template called 'Song' that uses a custom field called 'Lyrics'. Can I make it so that when I create a new page and set the template to be 'Song', that the 'Lyrics' custom field will be automatically added to that page?

I've been plowing through the codex, but I cannot find anything that says this is or is not possible...

Any help appreciated!

thx,
Jim.
__________________
Jim Offerman ~ music that moves you
blog - twitter - free music - join the fan club!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-15-2008, 07:24 PM
Senior Member
 
Join Date: Mar 2007
Location: Why, want to visit me?
Posts: 636
jamestl2 is on a distinguished road
Default

Have you looked at this page?:
Using Custom Fields « WordPress Codex

It sounds like what you want is to use a the_meta() template tag, which has to be a part of the loop.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-15-2008, 07:47 PM
Senior Member
 
Join Date: Jan 2007
Location: The Netherlands
Posts: 1,647
JimOfferman is on a distinguished road
Default

Yes, I read that page. But it only explains how I get my 'Lyrics' custom field onto the page that the website visitor sees.

But I'm talking about the administrator interface. What I want is for WordPress to somehow "know" that the Song template uses this field, so I don't have manually add the custom field to every song page I create. That would be highly convenient, because I'll be adding quite a few songs...
__________________
Jim Offerman ~ music that moves you
blog - twitter - free music - join the fan club!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-15-2008, 08:38 PM
Senior Member
 
Join Date: Mar 2007
Location: Why, want to visit me?
Posts: 636
jamestl2 is on a distinguished road
Default

This is probably something you'd want to ask over in the WP.org support forums, as they'd be much more knowledgeable on the subject.

One more thing I may suggest ATM is looking at this basic tutorial:
Using WordPress Custom Fields: Introduction: Using WordPress Custom Fields tutorial series

This quote from the article *might* be able to apply to what you want:
Quote:
What do I do with this information? You can pull this information out in posts, on other pages, into sidebars, or wherever.

To give a list of your book reviews in alphabetical order with the author’s name, you could create a custom field with a Key named “author” and a Value of “The Author’s Name” for several posts, or reviews. After writing these reviews and putting them into your “Book Reviews” category, you would put together a page called “Book Reviews” or create a category-specific template for your “Book Reviews” category.

Here’s how you would list each book review (category=27 would need to be changed to your “Book Reviews” category ID):
Code:
<ul>
<?php
$book_reviews = get_posts('category=27&numberposts=-1&orderby=post_name&order=ASC');
foreach($book_reviews as $post) : setup_postdata($post);
?>
<li>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
<?php $author = get_post_meta($post->ID, "author", $single = true);
	if($author !== '') {
	echo 'by ' . $author;
	} ?>
</li>
<?php endforeach; ?>
</ul>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-15-2008, 08:52 PM
Senior Member
 
Join Date: Jan 2007
Location: The Netherlands
Posts: 1,647
JimOfferman is on a distinguished road
Default

Quote:
Originally Posted by jamestl2 View Post
This quote from the article *might* be able to apply to what you want:
Thanks James, but that tutorial explains the bit that I already understand - namely how to use custom fields in my site. I want to talk to the WordPress page editor itself!

But your suggestions do highlight the reason why I have a hard time finding my answer: everyone (Google included) assumes I'm looking for help on how to use the fields in the website...

I'll try my luck on the WordPress forums...
__________________
Jim Offerman ~ music that moves you
blog - twitter - free music - join the fan club!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-27-2008, 07:13 PM
Member
 
Join Date: Nov 2006
Location: Milwaukee, WI, USA
Posts: 63
jpfieber is on a distinguished road
Send a message via AIM to jpfieber Send a message via MSN to jpfieber Send a message via Yahoo to jpfieber
Default

I think the problem you're running into is that in order to have a custom field for a post, the field must have a value. There is no sense displaying a field if there is no value for it. Depending on what you're doing, you may want to see if tags might do what you need. Where previously I was using a custom field and entering a value of 'true' to help me organize some posts that I didn't necessarily want in a full-blown category, now I just add a tag, and can view those posts on a /tag/ page, and create custom templates for that page.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to link to an archive in Wordpress? VacMan Technology & Technical Skills 11 01-24-2008 03:14 AM
Wordpress and Adsense Nahush Business & Financial 6 12-17-2007 08:19 AM
Very New to Wordpress jamestl2 Technology & Technical Skills 7 05-28-2007 05:43 AM
Stop WordPress Spam Adam Technology & Technical Skills 5 12-12-2006 05:42 PM


All times are GMT. The time now is 11:24 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 by Pavlina LLC