DIY Themes Forums  

Go Back   DIY Themes Forums > Thesis Theme > Thesis Customization Tips
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-29-2008, 07:02 AM
Junior Member
 
Join Date: Apr 2008
Posts: 13
Default Modified rotating_images.php

Not sure if anyone is interested, but I modified the rotating_images.php template in order to remove the multiple switch cases and IMG tags.

You can see this in action on my blog. Let me know what you think.

Thanks,
Claude

PHP Code:
<?php 

// This template is a modification to Chris Pearson's original rotating_images.php part of his Thesis theme for Wordpress. 
// Modifications by Claude Betancourt, cbetancourt@gmail.com 

// INSTRUCTIONS: 
// For best results, you should upload images that have common aspect ratios, such as: (Width x Height) 
// 4:3 — no additional class required (although you can use class="four_by_three" if you like) (420 x 315) 
// 3:2 — apply class="three_by_two" to the appropriate image declaration below (420 x 280) 
// 16:9 — apply class="sixteen_by_nine" to the appropriate image declaration below (420 x 236) 

// Modify this to a relative path, not necessarily inside the theme folder 
$imagePath '/images/blog/headers/'

// Create an empty array for our images 
$images = array(); 

    
// Repeat this block for each of your images 
    // while being careful to add the image file name, title (alt text) and aspect ratio class. 
    
$images[count($images)] = array( 
        
'imageName' => 'candles.jpg'
        
'title' => 'Candles'
        
'className' => '' 
    
); 

    
$images[count($images)] = array( 
        
'imageName' => 'emmy.jpg'
        
'title' => 'Emmy'
        
'className' => 'sixteen_by_nine' 
    
); 

    
$images[count($images)] = array( 
        
'imageName' => 'emmy-aota.jpg'
        
'title' => 'Emmy\'s Celebration of the Arts'
        
'className' => 'sixteen_by_nine' 
    
); 

    
$images[count($images)] = array( 
        
'imageName' => 'harley.jpg'
        
'title' => 'Harley'
        
'className' => 'sixteen_by_nine' 
    
); 

    
$images[count($images)] = array( 
        
'imageName' => 'hot-air-balloon.jpg'
        
'title' => 'Hot Air Balloon'
        
'className' => 'sixteen_by_nine' 
    
); 

    
$images[count($images)] = array( 
        
'imageName' => 'park.jpg'
        
'title' => 'Park'
        
'className' => 'sixteen_by_nine' 
    
); 

    
$images[count($images)] = array( 
        
'imageName' => 'sarah.jpg'
        
'title' => 'Sarah'
        
'className' => 'sixteen_by_nine' 
    
); 

    
$images[count($images)] = array( 
        
'imageName' => 'tulip.jpg'
        
'title' => 'Sarah\'s Tulips, 2008'
        
'className' => 'sixteen_by_nine' 
    
); 

// There is no need to modify the following lines 
$key rand(0,count($images)-1); 
$imageName $images[$key]['imageName']; 
$imageTitle $images[$key]['title'];
$imageClass $images[$key]['className'];
?>
                <img class="<?php echo $imageClass ?>" src="<?php echo $imagePath ?><?php echo $imageName ?>" alt="<?php echo $imageTitle ?>" title="<?php echo $imageTitle ?>" />

Last edited by cbetancourt : 04-29-2008 at 07:11 AM.
Reply With Quote
  #2 (permalink)  
Old 04-29-2008, 01:03 PM
Junior Member
 
Join Date: Apr 2008
Posts: 4
Default

That's a terrific mod. I especially like the idea of being able to create a pages for Amazon affiliate book sales. I don't monetize my site, at least not now, but that's certainly one tip that pushes me in that direction.
Reply With Quote
  #3 (permalink)  
Old 04-29-2008, 05:12 PM
Junior Member
 
Join Date: Apr 2008
Posts: 13
Default

Malexder: For the books page I use a modified version of page_with_comments.php named page_without_sidebars.php, which looks like this:

PHP Code:
<?php
/*
Template Name: Page without Sidebars
*/

include (TEMPLATEPATH '/config.php');
get_header();
?>
    <style type="text/css">
    #content_box {
        width: 100%;
        text-align: left;
        background: none;
    }
        #content_box #content {
            width: 100%;
        }
            #content_box #content .content_inner {
                width: 100%;
            }
    </style>
    <div id="content_box">
    
        <div id="content" class="page">
<?php 
        
if (have_posts()) : 
            while (
have_posts()) : 
                
the_post();
?>
        
            <div class="content_inner">
                <h1><?php the_title(); ?></h1>    
                <div class="format_text">        
<?php the_content('<p>Read the rest of this page &rarr;</p>'); ?>
<?php link_pages
('<p><strong>Pages:</strong> ''</p>''number'); ?>
                </div>
            </div>
                
<?php 
                comments_template
();
            endwhile;
        endif;
?>

        </div>

    </div>

<?php get_footer(); ?>
Reply With Quote
  #4 (permalink)  
Old 04-30-2008, 03:58 AM
Junior Member
 
Join Date: Apr 2008
Posts: 6
Default

how did you get the different color background? Let me clarify, you have a white background as the center and the beige on the sides. How did you manage that?
Reply With Quote
  #5 (permalink)  
Old 04-30-2008, 04:46 AM
Junior Member
 
Join Date: Apr 2008
Location: Los Angeles
Posts: 29
Send a message via AIM to jfhscribbles Send a message via Skype™ to jfhscribbles
Default

Quote:
Originally Posted by pedro View Post
how did you get the different color background? Let me clarify, you have a white background as the center and the beige on the sides. How did you manage that?
You can find out exactly how to do that here.
__________________
Design better. Write better.
http://scribblesandwords.com/
Reply With Quote
  #6 (permalink)  
Old 04-30-2008, 05:40 AM
Junior Member
 
Join Date: Apr 2008
Posts: 13
Default

Quote:
Originally Posted by pedro View Post
how did you get the different color background? Let me clarify, you have a white background as the center and the beige on the sides. How did you manage that?
In essence, the entire body background is beige and then the container is white. The grey borders are part of the container definition. Take a look at this post, but make sure to use the latest version of custom.css available here as I have made more modifications to the one posted yesterday.
Reply With Quote
  #7 (permalink)  
Old 05-20-2008, 08:32 AM
Member
 
Join Date: Apr 2008
Posts: 40
Default

nice stuff! How did you change the background color of your tab? How would I go about using different background colors for each tab? Thanks!
Reply With Quote
  #8 (permalink)  
Old 05-20-2008, 03:34 PM
Junior Member
 
Join Date: May 2008
Location: London, UK
Posts: 19
Default

Great mod, thanks!

It would be perfect if in the mod there was also a way to add links to images.
Reply With Quote
  #9 (permalink)  
Old 07-28-2008, 09:22 PM
Junior Member
 
Join Date: Jul 2008
Posts: 15
Default

Claude if you have time... I am trying to impliment your mod and appears to be working but is leaving me some strange code at the top of my page: Search Homes — Real Estate 101

Warning: include(/home/content/g/o/o/gooseaus/html/wp-content/themes/thesis/config.php) [function.include]: failed to open stream: No such file or directory in /home/content/g/o/o/gooseaus/html/wp-content/themes/thesis/page_without_sidebars.php on line 6

Warning: include() [function.include]: Failed opening '/home/content/g/o/o/gooseaus/html/wp-content/themes/thesis/config.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/g/o/o/gooseaus/html/wp-content/themes/thesis/page_without_sidebars.php on line 6

I am a new to this so bear with me... I created a new php in Dreamweaver pasted the code you provided and saved as: page_without_sidebars.php then uploaded it. Then switched the page template to: page_without_sidebars.php using wordpress dashboard...

Any ideas about what I'm doing wrong?
Reply With Quote
  #10 (permalink)  
Old 07-28-2008, 10:00 PM
Senior Member
 
Join Date: Jul 2008
Location: Connersville, IN
Posts: 2,244
Send a message via ICQ to kingdomgeek Send a message via AIM to kingdomgeek Send a message via MSN to kingdomgeek Send a message via Yahoo to kingdomgeek
Default

noells: There's already a page template in Thesis called page_no_sidebars.php -- Does it not do what you want?

(I'm thinking everything in this thread applies to a version of Thesis prior to 1.0.0 and shouldn't be used on an up-to-date Thesis installation.)
__________________
Rick Beckman, Kingdom Geek & Thesis Support Ninja (Forums Moderator)
[ Thesis Manual | Help, my posts don't show up! ]


Amazon Wishlist | My custom.css
Get Thesis! | Earn Cash as a DIY Affiliate!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:34 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0