Support » Themes and Templates » How to put numbers on image gallery?

  • Is there a way or modification to put numbers on the default image gallery? A small number being displayed at the top of the image like they have at

    Signs full of ‘WTF’ (37 Photos)

    Every image in the gallery has got numbers in chronological order at the top-right corner.

    How to do it?


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


    Forum Moderator

    you can ‘copy’ the gallery code into functions.php of your theme, and edit it there;

    function custom_gallery_shorcode() {
    // full code see pastebin //

    (for wp3.7.1 )

    line 108 outputs the number:
    $output .= "<div class='imageNum'><span>".($i+1)."</span></div>"; //NEW

    your sample site uses styles similar to these to format the output:

    .gallery dl{margin-top:15px;}
    .imageNum span{text-align:center;padding:3px;}

    I am sorry could you please elaborate the steps.

    I copy gallery css code into function.php?



    Forum Moderator

    step 1:
    paste the code from the pastebin link into functions.php of your theme;
    step 2:
    paste the css code at the end of style.css of your theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to put numbers on image gallery?’ is closed to new replies.