0

I am creating a custom website by modifying the twenty-eleven theme. I want to create custom text in the header area that is unique to each page. Is there a way to add a 'description' to each page and then use php to call on that description? Currently it displays the "site title"

here is the url to the site so you can see what im talking about.

www.tenspeedgreens.com

where it says 'ten-speed greens' is where i would like the custom text to be displayed.

thanks

  • Just to clarify, you are talking about the <h1> text under the logo right, not the <title> text? – Josh Mountain Feb 26 '13 at 17:22
  • Would be nice if you located (and posted) the code in the theme that prints the site title. – brasofilo Feb 26 '13 at 17:41
1

For something like this, you can use WordPress's built-in "Custom Fields" feature.

Step 1

On your edit page, create a new Custom Field (if you don't see the Custom Fields box on your edit screen, click on the grey"Screen Options" tab at the top-right of the page, and make sure the "Custom Fields" box is checked). The name can be anything, for example let's assume you want to use "Page Description"...

Step 2

Finally, output that custom field into your theme. Do this by using the following snippet wherever you want to output the custom description text...

<?php echo get_post_meta(get_the_ID(),'Page Description',true); ?>

One more thing... WordPress will remember the name of your Custom Field. Any time you want to use it on a page or post, you can select the name from a drop-down and then enter your description for that page/post.

  • genius! Thank you so much for your help. I know its kind of a noob question but I thank you for looking beyond that and answering this for me. – user28053 Feb 26 '13 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.