Support » Fixing WordPress » How to Display Specific Post ID (help)

  • Wanted to display specific post id in homepage. Did try to edit but no luck, the custom functions.php:

    function the_crumbs() {
    if (!is_home()) {
    echo ‘You are here: <a href=”‘;
    echo get_option(‘home’);
    echo ‘”>’;
    echo ‘Home’; // Home Link Text, change this to meet your needs
    echo ”   »  “;
    if (is_category() || is_single()) {
    the_category(‘, ‘,’&title_li=’);
    if (is_single()) {
    echo ”  »  “;
    the_title();
    }
    } elseif (is_page()) {
    echo the_title();
    }}}

    Anyone who knows how?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I think you will need to give some info, I’m not sure what you mean. You want to display a post id in the home page. Does this mean –

    – you want to display the whole post including the title and content?

    – you want to display just the ID number for the post?

    – you want to display the post ID in the breadcrumbs?

    Please can you give us some more info.

    Thanks

    Yes, that’s it I want to display the post ID in the breadcrumbs. Above is the current code in my theme, I am still a beginner for this. I really appreciate your help.

    Ok, I *think* this should work but haven’t tested it –

    Add the_ID();

    next to

    the_title();

    so it’s like

    the_title(); the_ID();

    Or you could display it differently like:

    the_title(); - the_ID();

    which will look like ‘Something post name – 255’
    or

    the_title(); <em>the_ID();</em>

    which should look like ‘Something post name 255

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to Display Specific Post ID (help)’ is closed to new replies.