Hi i want to add expire date costum field to index this is the code for post layout

<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly
}

add_action( 'nine2five_loop_content', 'nine2five_get_listing_details' );
function nine2five_get_listing_details() {
    global $post;
    if (get_option("9t5_new_days") == ""){
        $days = 1;
    } else {
        $days = get_option("9t5_new_days");
    }
    $days = "-" . $days ." days";
    $newtagdisplay = strtotime($days);
    $post_time = get_the_time('U');
    $company_name = ( get_post_meta( $post->ID, 'company_name_value', true ) == "" ? __('Anonymous', '9to5') : get_post_meta( $post->ID, 'company_name_value', true ) );
    $exp = get_post_meta( $post->ID, "exp_value", true );
    $output = '<div class="details">';

        ob_start();
    ?>
        <div class="pull-left">
            <div class="cf">
                <?php if ($post_time > $newtagdisplay) : ?><em class="new <?php echo get_option('9t5_color_secondary'); ?>"><?php _e('New', '9to5') ?></em><?php endif; ?>
                <h3><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h3>
            </div>
            <div class="company">
                <p><?php echo $company_name; ?></p>
            </div>
        </div>
    <?php
        $inner_details = ob_get_contents();
        ob_end_clean();

    $output .= apply_filters( 'nine2five_add_listing_details_inner', $inner_details );

    $output .= '</div>';

    echo apply_filters( 'nine2five_add_listing_details', $output );

}

please any one can help me how to put the right code for display Expire date ACF in the index for this code

Read more here: i want to add ACF expire date in the index


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: