Forums

Best way to create custom Description on a Page? (1 post)

  1. mismatchedpear
    Member
    Posted 2 years ago #

    I'm new to Custom Fields, so please bear with me.

    I have a lot of "if / else" statements in my Header. My header is the fluctuating update field where I write the newest news that doesn't belong in a post.

    However, when a user visits a page, I don't want it to display news, I want it to display an excerpt or description of the Page they are on.

    Instead of writing

    <?php if ( is_page('about') ) { ?> ... ... ...
    <?php if ( is_page('page1') ) { ?> ... ... ...
    <?php if ( is_page('page2') ) { ?> ... ... ...

    Is there an easier way to have there only be ONE statement in the header using Custom Fields? So that I would input my Page Description in the Custom Field box, and using:
    <?php the_meta(); ?> I could call each page's description with one line of code instead of a separate line of code for each page?

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by mismatchedpear
  • This topic is not resolved
  • WordPress version: 2.9.1