Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Ordered lists with PHP? (WordPress)

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #39428
    chrisburton
    Participant

    Overall what I’m trying to do is list the number of attachments (1, 2, etc) for each post on a page. When you click on a number, it will change the image. Pretty much like a slideshow. How would I go about adding the numbers in my loop or could this be better solved via jQuery?

    The reason I am not using OL’s is because it outputs a period after the number which I absolutely do not want.

    Code (so far):

    
    if( function_exists( 'attachments_get_attachments' ) )
    {
    $attachments = attachments_get_attachments();
    $total_attachments = count( $attachments );
    if( $total_attachments ) : ?>


    Desired Output (view source HTML):

  • 1

  • 2

  • 3
  • #108145
    chrisburton
    Participant

    Solution:

    
    if( function_exists( 'attachments_get_attachments' ) )
    {
    $attachments = attachments_get_attachments();
    $total_attachments = count( $attachments );
    if( $total_attachments ) : ?>


Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.