help with simple one line of script please, wordpress meta info

Discussion in 'PHP' started by pathfinder_05, Oct 24, 2009.

  1. #1
    Hi guys,

    I need something that does the following (it is regarding the post meta info on Wordpress) -

    Here is the plain English of what I'm trying to do.

    """If there is post meta, goto meta.php, if not, ignore meta.php""""

    Meta.php has styling/layout info and what meta info I want to display.

    Thanks for any help.

    DB
     
    pathfinder_05, Oct 24, 2009 IP
  2. Sky AK47

    Sky AK47 Member

    Messages:
    298
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #2
    I'm not really sure what you mean with post meta, but something like this?
    
    if(the_meta()){
    	header('Location: meta.php');
    }
    
    PHP:
     
    Sky AK47, Oct 24, 2009 IP
  3. pathfinder_05

    pathfinder_05 Member

    Messages:
    94
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #3
    Thanks for the reply.

    I didn't know there was a website dedicated to php. So using your example, the wordpress site, the php site and shear luck this is what seems to have worked.

    
    <?php 
    if (get_post_meta($post->ID, 'itinerary_header', $single = true)) include ('meta.php');
    else 
    get_sidebar ('Tribal'); 
    ?>
    
    Code (markup):
    Still looks like gobble de gook to me. But it does exactly what I want. If there is meta data the 'meta.php' file is opened and also the 'sidebar' isn't.

    DB
     
    pathfinder_05, Oct 24, 2009 IP