Display WordPress Post Number on Single Page with post ID

94

You can see it work throughout this wordpress blog, to the right you see DCE Article 94. Notice you can select the number as text. The number is pulled from the post on every single page by placing this line of code in your wordpress single.php template page.

<?php the_ID(); ?>

Note: When using this line of code be sure it is between these two lines of code in your single.php page

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<?php endwhile; else: ?>

I place the code in its own div with a background image to create the illusion of unity. I use margins to move the number to the right spot of the image. My CSS and Code looks like this.

<style>
#page_number_id_spawn { float:left; text-align:right; margin-top:240px; width:135px; color:#900; font-size:30px; font-family:Georgia, ‘Times New Roman’, Times, serif;}</style>

<div id=”page_number_id_spawn”><?php the_ID(); ?></div>



16 comments ↓

If you found this post useful click the share this button. Contribute below by adding a comment, no registration is required.

  • godless_phoenix says on 02.05.09 at 9:08 am comment #1

    Thx, its working.

  • onewego says on 10.29.09 at 4:42 pm comment #2

    I’m trying to create a custom theme for my iPhone. Does anyone know how I can actually make it myself? I don’t want to download anything like un-lockable because I want it to be my own so I can upload it to cydia when the theme is complete. Please help!

    ________________
    unlock iphone 3gs

  • LorencoVoR says on 12.09.10 at 7:44 pm comment #3

    What do you think about WIKILEAKS?
    Hope for no silence

  • AssangeLiveDox says on 01.06.11 at 12:24 pm comment #4

    I need to contact site admin urgently. Can you understand me?
    Thank you
    bye bye ;) )

  • escaccame says on 01.08.11 at 2:35 am comment #5

    rajstopy

  • genexellis says on 04.23.11 at 3:38 pm comment #6

    I am the first time here on this page and therefore first of all i sooo want to speak hi to everybody

  • eddiexadkins says on 04.24.11 at 12:14 am comment #7

    I am the first time here appropriate here and so to start with i desires to would say heya to each and every individual

  • tiodкекке says on 04.25.11 at 3:36 am comment #8

    Прошлым летом был в Одессе отдых супер понравилась все
    снять квартиру помогли minihotel.com.ua
    Аренда недвижимости
    сэкономил и время и деньги , ребята молодцы решил все в течении одного часа так держать ))

  • Chulenin says on 04.30.11 at 4:44 pm comment #9

    Приветствую!
    Жара в этом году бьёт совершенно рекорды и я уже не знаю где спасаться, жарко даже в теньке, вентиляторы тупо разгоняют жару и всё, поэтому решил подкупать себе в комнату кондей чтобы хотя желание отдыхать нормально, не в бане, буду брать путем инет, в вот такой кондиционерчик, как куплю – отпишусь о впечатлениях. Вам тоже я рекомендую задуматься о приобретении кондея.

  • polikovmaksa says on 05.05.11 at 1:04 pm comment #10

    Привет всем, кто хочет потрогать отличные буфера? красивые проститутки и сучки. Звезды порно!
    Заходите на сайт заходим сюда

  • numbis_82 says on 05.19.11 at 9:47 am comment #11

    good day everybody,
    simply want to speak “howdy”, hope to pay a few attractive instance around this message board :D

  • reindeer_ruthless_1 says on 05.25.11 at 11:58 am comment #12

    hiya absolutely everyone,
    only want to write “hi”, anticipate to pay a number of fine time around this community forum :-)
    check into mine portal: Meble biurowe warszawa

  • mare_thirsty _73 says on 05.25.11 at 9:19 pm comment #13

    greetings everyone,
    want to tell you “greetings”, dream to shell out a number of fine time for this website :]
    visit on mine www: drzwi

  • maximum_pinkie_12 says on 05.27.11 at 11:28 am comment #14

    hey everybody,
    just want to tell you “howdy”, hope to pay quite a few good time with this blog ;)
    feel invited into my portal: konferencje

  • abercrombie fitch uk says on 07.11.11 at 6:38 am comment #15

    In my opinion you are not right. Write to me in

    PM.

  • UrawerSesE says on 10.01.11 at 3:53 am comment #16

    Your advantages: lowest rates, no reservation fees, payment at the hotel , no cancellation fee. Hotel Granducale *** Antwerp. Cosy breakfast room Make online hotel reservations at any Red Roof Inn. Book Room(s). Step 4. Confirm Reservation. Other ways to find an inn: In a city, near an airport or Active Hotels : Book online and save at thousands of hotels in thousands of locations, read reviews from thousands of satisfied customers.

Leave a Comment