• Resolved Hugo Parrales

    (@hugodroid)


    Hi, I have a question .
    as I can do to show a custom field for a job in another post .
    What I do is eg job title this field , I want to show it in post child.

    I thought I could do it

    get_post_meta( $post->ID….

    but that just shows me the current field post
    and I could not do with the post parent

    Can you help me ?

    https://wordpress.org/plugins/wp-job-manager/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Mike Jolley

    (@mikejolley)

    Job’s don’t have parents – they are not hierarchical. So I’m not sure what you’re trying to do.

    In general, you get the parent ID with $post->post_parent anyway.

    Thread Starter Hugo Parrales

    (@hugodroid)

    with the job application created post in a job , what I want is to display the post meta of job within the job application

    Hi there,

    Still confused about what you are trying to do here but will try to help.

    Can you try one more time (from the beginning) what you are trying to achieve and Mike and I can help point you in the right direction.

    Kind Regards,
    Scott

    Thread Starter Hugo Parrales

    (@hugodroid)

    Yes, sorry for my English .

    What I seek is this;

    I have a page that has the salary meta, then I want show this field salary in another page or post

    Page 1 : Has the salary meta
    Page 2 shows the same salary meta

    I tried to “get post meta” , but shows the salary field of that post and not from page 1 , not if you understand me.

    Plugin Author Mike Jolley

    (@mikejolley)

    You mentioned applications; did you try replacing $post->ID with $post->post_parent? That is the ID of the job in the case of applications.

    Thread Starter Hugo Parrales

    (@hugodroid)

    Yes, i try;

    <?php echo get_post_meta( $post->post_parent, ‘_salary’, true ); ?>

    but not working.

    what I want is that in the job- application.php file display a meta file to content- job_listing.php or content-single-job_listing.php

    or otherwise in page “applications” certain meta fields in the “job” see page

    Plugin Author Mike Jolley

    (@mikejolley)

    There is no job-application.php. Why don’t you upload your full code/file for us?

    Thread Starter Hugo Parrales

    (@hugodroid)

    what I want is this, I have a page where applications do a specific job and the portion of code that controls this is this is :

    <section class=”job-application-content”>
    <?php job_application_meta( $application ); ?>
    <div id=”info”><h5>Estos son los campos del empleo al que estas optando</h5></div>
    <div id=”salario”><h5>Salario:
    <?php echo get_post_meta( $post->post_parent, ‘_salary’, true ); ?></h5></div>
    </section>

    Thread Starter Hugo Parrales

    (@hugodroid)

    This:
    <div id=”salario”><h5>Salario:
    <?php echo get_post_meta( $post->post_parent, ‘_salary’, true ); ?></h5></div>

    should show ” salary ” published in the job

    Plugin Author Mike Jolley

    (@mikejolley)

    Ok, $application is the ‘post’ in this case, so you need to use:

    $application->post_parent

    to get the job ID.

    Thread Starter Hugo Parrales

    (@hugodroid)

    WOW!!!!!! You are a Genuis!!, Thats Work!

    Thanks you!!!

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Post parent’ is closed to new replies.