• artisan5

    (@artisan5)


    How do I replace the php command which shows the date of a post with a command to show an ID or other type of tracking number instead such as Entry 1, Entry 2, etc.? Please include which file and section to place the code, since I’m not great at PHP yet. Many thanks…

Viewing 3 replies - 1 through 3 (of 3 total)
  • MichaelH

    (@michaelh)

    You probably have the_date('') or the_time('') already, so you might try in your loop:
    `
    <?php
    echo ‘typical post id in the loop ‘. $post->ID;
    ?>

    Thread Starter artisan5

    (@artisan5)

    I tried replacing the_time code in the page.php template with the php you’re suggesting. I must be doing something wrong because the date is still there under the article header.

    Should it look like this?

    <?php the_time(__(echo ‘typical post id in the loop ‘. $post->ID;)) ?>

    MichaelH

    (@michaelh)

    <?php the_time(__(echo 'typical post id in the loop '. $post->ID;)) ?>

    should be:

    <?php
    echo 'typical post id in the loop '. $post->ID;
    ?>

    Related:
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy
    the_time()

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Replacing date with ID number’ is closed to new replies.