• Hi
    I love the grid-a-licious theme, however theres one thing i would like to change and wondered if it was possible?

    On the main page i want it to just have a grid of images, that when one is clicked it then enters the blog post where i can have some text.
    The reason being is that i need to have lots of writing on each post and it clutters up the main page.

    Many Thanks for any help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter brisa_main

    (@brisa_main)

    Any ideas?
    This is where i got it from:
    https://suprb.com/grid-a-licious/

    Thread Starter brisa_main

    (@brisa_main)

    I can provide the code for any of these sections if it helps:
    Comments (comments.php)
    Footer (footer.php)
    Header (header.php)
    Main Index Template (index.php)
    Page Template (page.php)
    Single Post (single.php)

    I guess it’s all about stripping everything but the image itself, right?

    Something like this might work: (haven’t tested it!)

    index.php

    <?php get_header(); ?>
    
    <div class="navigation_group">
    	<?php next_posts_link('<div class="eachpost "><div>&mdash;Older</div></div>') ?>
    	<?php previous_posts_link('<div class="eachpost "><div>Newer&mdash;</div></div>') ?>
    </div>
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<?php 
    
    			$upload_path = get_option( 'upload_path' );
    			$upload_path = trim($upload_path);
    
    			$img_full_url = post_image();
    
    			if ($img_full_url != "") {	
    
    			$temp = substr(strrchr($upload_path, "/"), 1);
    
    			list($url, $filename) = explode($temp, $img_full_url);
    
    			$img_url = $upload_path . "/" . $filename;
    
    			$imagesize = getimagesize($img_url);
    			list($width, $height, $type, $attr) = getimagesize($img_url);
    			$theClass = "eachpost ";
    			if ( $width < "440" ) { $new_width = "200"; $theClass = "eachpost "; }
    				else if ( $width < "660" ) { $new_width = "430"; $theClass = "eachpost twocols"; }
    					else { $new_width = "660"; $theClass = "eachpost threecols"; }
    
    			$new_height = ($height*$new_width)/$width;
    			echo '<div class="'.$theClass.'">
    					<div><a href="<?php the_permalink() ?>" rel="bookmark">'; ?>
    
    			<?php echo '<img src="' . $img_full_url . '" width="' . $new_width . '" height="' . $new_height . '" /></a>'; } ?>			
    
      	 </div>
      </div> 
    
        <?php if ( comments_open() ) comments_template(); ?>
    
    <?php endwhile; else: ?>
    <div class="warning">
    	<p>Sorry, but you are looking for something that isn't here.</p>
    </div>
    <?php endif; ?>
    
    <div class="navigation_group">
    	<?php next_posts_link('<div class="eachpost "><div>&mdash;Older</div></div>') ?>
    	<?php previous_posts_link('<div class="eachpost "><div>Newer&mdash;</div></div>') ?>
    </div>
    
        <?php get_footer(); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Grid-a-licious amendments!’ is closed to new replies.