Forums

Rewrite a function to show first pic as thumb (8 posts)

  1. maranello2
    Member
    Posted 1 year ago #

    Im using a theme that have a function for showing a thumb in "the_excerpt" on the first page, but the function does use the last photo if i have several in the post, not the first. Could this function be edited to show only the first image in the post?

    Link to the function

  2. Michael Fields
    Theme Wrangler
    Posted 1 year ago #

  3. ljmyers
    Member
    Posted 1 year ago #

    When you add this code into your single.php (in the loop), it will show all images uploaded into gallery for that post . . .
    <?php echo do_shortcode("[gallery]"); ?>
    - or -
    To show only the first image this plugin is great and up to date. . .
    Get The Image Plugin

    Hope this helps

  4. maranello2
    Member
    Posted 1 year ago #

    Thanks Michael, but its still showing the last pic uploaded... Check the post on my site http://www.holten-motorsport.no/wp

  5. Michael Fields
    Theme Wrangler
    Posted 1 year ago #

    Hmmm, What happens if you change 'orderby' => 'menu_order', to 'orderby' => 'post_date',

  6. maranello2
    Member
    Posted 1 year ago #

    Woho! Seems to work! I will try making a new post as well to test it out, thanks for fast reply Michael!

  7. Michael Fields
    Theme Wrangler
    Posted 1 year ago #

    No problem!

  8. maranello2
    Member
    Posted 1 year ago #

    I did work out! Again, thank you very much! :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.