Support

Account

Home Forums General Issues Adding custom field to end of title from Post_Object

Solved

Adding custom field to end of title from Post_Object

  • Hi everyone,

    I hope that someone can help me. I have used Post_Object to get a drop down of a custom post type. Unfortunately they have very similar names throughout (as they are cars). There is a custom field called derivative, and i’m hoping to somehow attach the derivative from each of the custom post types on the end of the title on the post_object drop down.

    Do you know how I can do this?

    Its rather complicated.. I know it will be something to do with altering the post_object.php file but I don’t know what to add to add this on the end.

    I have tried things like :

    $title .= ‘ (‘ .get_the_title( $p->ID ). ‘)(‘ .get_field(“derivative”, $p->ID)’)’;
    and
    $title = get_the_title( $p->ID ), get_field(‘derivative’, $p->ID);
    and
    $title = array(get_the_title( $p->ID ) == get_field(‘derivative’, $p->ID));

    But none of them work and all end up breaking the option or the page.

    Any ideas on how to do this would be great!

    Chris

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Adding custom field to end of title from Post_Object’ is closed to new replies.