The MU forums have moved to WordPress.org

Passing Custom Field Values Between Pages (1 post)

  1. ljmyers
    Member
    Posted 14 years ago #

    Via this plugin, I have created a custom write panel for the write post page. Lets say that the custom inputs are . . .

    Name: $key = _name
    From: $key = _from

    I am using the following to call the values to the post - known as single.php in wp themes of course.

    <?php if(get_post_meta($post->ID, "_name", true)): ?>
    <p><?php $key="_name"; echo get_post_meta($post->ID, $key, true); ?></p>
    <?php endif; ?>
    
    <?php if(get_post_meta($post->ID, "_from", true)): ?>
    <?php $key="_from"; echo get_post_meta($post->ID, $key, true); ?>
    <?php endif; ?>

    I have created a page template in the theme that we'll call single2.php. I have also created a page in the admin panel to accommodate the page2.php template.

    What I want to accomplish is passing the key values _name and _from, from the single.php or post, to the single2.php page template.

    e.g. When you click on a link in the post/single.php, it will take you to the page/single2.php where you can see the same values that were in the previous post page.

    Any help would be great while keeping in mind that you are talking to someone who does not have an "in depth" knowledge of php. My apologies for taking your time but I have searched high and low for help with this issue with no real luck.

    Thanks so much, Lana Banana

About this Topic

  • Started 14 years ago by ljmyers