Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ssccdd

    (@ssccdd)

    hahaha immediately after posting this i noticed my mistake.

    had:
    the_post_thumbnail();

    when it should have been:
    the_post_thumbnail(‘thumbnail’);

    now it works and everything looks lined up!

    Thread Starter ssccdd

    (@ssccdd)

    hm the inline block thing didn’t totally work because i don’t have a finite number of divs in a row to enclose in a table row. here’s what happens https://i.imgur.com/yguBb8v.jpg (the green is the inline block and the red is a block wrapper)
    anyway probably just need to mess with the css not too worried about that.

    my main remaining issue is that code doesn’t pull in thumbnails for me, rather the full image. wanted to make the images all square thumbnails, and from reading the codex that should pull in the thumbs, i have “add_theme_support( ‘post-thumbnails’ );” in the functions.php. any ideas on why this is happening?

    still using mostly the same code posted above

    thanks for your help tokant!

    Thread Starter ssccdd

    (@ssccdd)

    immediately after posting it i realized i wasn’t setting a featured image, the code is working now, sorry! but if anyone still has advice on how to get each thumbnail in a 6 column grid that would be great.

    Thread Starter ssccdd

    (@ssccdd)

    was able to get the images working with this code in the loop on index.php, but I can’t seem to figure out an equivalent for vimeo videos:

    <?php
         // IMAGES
         $allPost = $post->post_content; 
    
         $images = array();
         preg_match_all('/(img|src)\=(\"|\')[^\"\'\>]+/i', $allPost, $media);
         unset($allPost);
         $allPost=preg_replace('/(img|src)(\"|\'|\=\"|\=\')(.*)/i',"$3",$media[0]);
         foreach($allPost as $url)
         {
              $info = pathinfo($url);
              if (isset($info['extension']))
              {
                   if (($info['extension'] == 'jpg') ||
                   $info['extension'] == 'jpeg') ||
                   ($info['extension'] == 'gif') ||
                   ($info['extension'] == 'png'))
                   array_push($images, $url);
              }
              }
    
         $numImages = count($images);
    
         for ( $i = 0; $i < $numImages; $i ++) {
              echo '<div class="postphotowrapper">';
              echo '<img src="'.$images[$i].'">';
              echo "</div>";
         }
    ?>
Viewing 4 replies - 1 through 4 (of 4 total)