WordPress.org

Ready to get started?Download WordPress

Forums

Post Types Order
[resolved] Retrieving a custom field to display next to the name (3 posts)

  1. Bravo315
    Member
    Posted 1 year ago #

    Hi all

    Does anyone know what line I could go around and insert the_field('custom_value'); and get it to print that value next to the name of the $post?

    Thanks.

    http://wordpress.org/extend/plugins/post-types-order/

  2. nsp-code
    Member
    Plugin Author

    Posted 1 year ago #

    Hi
    You can try to edit the line 333 on post-types-order.php file:

    $output .= $indent . '<li id="item_'.$page->ID.'"><span>'.apply_filters( 'the_title', $page->post_title, $page->ID ).'</span>';

    to

    $output .= $indent . '<li id="item_'.$page->ID.'"><span>'.apply_filters( 'the_title', $page->post_title, $page->ID ).' - ' . $custom_field_value .'</span>';

    Or if you own the Advanced Post Types Order plugin you can use this easy example http://www.nsp-code.com/advanced-post-types-order-api/filter-post-types-items-additional-informations/

  3. Bravo315
    Member
    Posted 1 year ago #

    Thanks for the reply.

    However, it doesn't output the $custom_field_value. It outputs the dash before it but even if I change "$custom_field_value" to "$post_title" it won't output the post title again either.

    Once again, I do appreciate your help with this. but unfortunately that didn't work. Unfortunately my business cannot purchase Advanced Post Types Order for this one function.

    Cheers,
    Jack.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic