[resolved] Add Post ID to Post entry meta (2 posts)

  1. jexinnovations
    Posted 2 years ago #

    I want to add the "Post/Page ID" next to "Date Posted" in the entry meta section for each of my posts. (To be used as en easily visible product number- done after the fact)

    After browsing around, I feel like the edit would be on the content.php page. I feel like it should be a fairly easy fix, but I haven't been able to find the right to documentation to help me implement.

    [please mark any posted code - http://codex.wordpress.org/Forum_Welcome#Posting_Code - the code below is partially broken]

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<header class="entry-header">
    		<?php if ( ! is_singular() ) { ?>
    			<h1 class="entry-title">
    				<a>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'mixfolio' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark">
    					<?php the_title(); ?>
    			</h1><!-- .entry-title -->
    		<?php } else { ?>
    			<h1 class="entry-title">
    				<?php the_title(); ?>
    			</h1><!-- .entry-title -->
    		<?php } ?>
    		<?php if ( 'post' == get_post_type() ) : ?>
    			<div class="entry-meta">
    				<?php mixfolio_posted_on(); ?>
    				<?php mixfolio_posted_by(); ?>
    			</div><!-- .entry-meta -->
    		<?php endif; ?>
    	</header><!-- .entry-header -->
  2. jexinnovations
    Posted 2 years ago #

    Figured it out (knew it was an easy fix)

    <p>Post Number: <?php the_ID(); ?></p>

Topic Closed

This topic has been closed to new replies.

About this Topic